Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp359697rwr; Wed, 19 Apr 2023 07:28:29 -0700 (PDT) X-Google-Smtp-Source: AKy350aNSY23LKHzF72JCHCLv8zBlOc1DzsYTwmgNVd61FDSminWQIwP0s5XF1ZPKeFmywQ+jjia X-Received: by 2002:a05:6a00:1799:b0:63b:8b47:454f with SMTP id s25-20020a056a00179900b0063b8b47454fmr4247461pfg.13.1681914508762; Wed, 19 Apr 2023 07:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681914508; cv=none; d=google.com; s=arc-20160816; b=hwSJV0TQw9fQ9eUZ1Gqqv85Fe3B63vgtMi8T72iOgH3MmdeWIfzcnV9NV/yeawvPuq 5d60mpB4JBBRROx9qFBIEZJ7uhBvMD5i2OoQx2df8u7EEyLLrudNHVDqqiy/s9b9R6B8 T/IekvTL0RyJWWTnmHGcChwBIHE38yX9GOLHJ7YacDIhjD0z6BTyRtO/unYHKgkG527w i/ArifoS5zD8UCz4A9n5CM+FB21hmZndKahRobR17VsYNvsWfKbM5jm7J3EQC35FEfBe W2PFIe6B+tgbi00ANd6AMWm+Yk1S3A2kp3dhwLfu6j+S63CMc92p4vjt1gG0dQ3lPREy bDpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=pMc7fQBWe3Bi35jcVdXtRtvRDvXrcOa0szVfpwPrY64=; b=W8GKmu9IbnI+OyCp3Ky4jk17yINXiNpZ8fqCRL0fHkPejnrqyHw2JvXuIfCtfyFwtw /tZV74pSQN3C1/NhYLo+hMVCWPZnQ0eM5KNMmFsiOob8Udzq8RnvuScVwVlXToa9caJW b3wJTtaV7yjySH2svGGFFc5WxBAcnUaurkmR/9GosbKLuIqI6Uog9TFyiwMCbUfRifns 9heu/Qy0d655y9HvPOWAr8Y3Y0HpSvUOzmIvYPVx9+8X7O7ZHUurYpmTm5pPJq+pcboU IXOeocQai2t3QziE/5cPxGBgUZ6U1VdQmB0BwxoFFPxsvnDydPzLDuPtLW3nSeEfdppV 9MJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BcWZUFJC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w191-20020a6382c8000000b00513a2e4d889si15327873pgd.475.2023.04.19.07.28.17; Wed, 19 Apr 2023 07:28:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BcWZUFJC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232823AbjDSO1n (ORCPT + 99 others); Wed, 19 Apr 2023 10:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232125AbjDSO1k (ORCPT ); Wed, 19 Apr 2023 10:27:40 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3778310CB for ; Wed, 19 Apr 2023 07:27:11 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f086770a50so23475125e9.2 for ; Wed, 19 Apr 2023 07:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681914427; x=1684506427; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=pMc7fQBWe3Bi35jcVdXtRtvRDvXrcOa0szVfpwPrY64=; b=BcWZUFJCqODc0M0FT5cCKCyz2EiZMOm0KE0JFo7V1mXSKSXmBpLF70JtQmsutdDLCD WvDnVzkzICHEhVq+O4+XmnKQbybPAs+A89umGecQ8Dy1Qc1bF/skddnE3qR189uDM1JA 7WaAshMHtFUv13tmKlFDN35bcRXO4cGbyht4e0WJ+BIalvWUyZwYkdynviGD25781O+C AxhW2dTfMcwhMfpcnEFc7qs4KdaStHRdFmRxyExj/0jM1y4QMKDNWTVS2yrERaTPucdl RJ8udrHkxvWBqGzZzw9Q12isHHIDPbdz9DAd+Wt4mZfJnpwftKRCAZ2TR8B8M66WH71z BTWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681914427; x=1684506427; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pMc7fQBWe3Bi35jcVdXtRtvRDvXrcOa0szVfpwPrY64=; b=Rxk9dzbNFzyPfliCXFJzI5raqWA5NH1k/VccKpaglDl+jXni0gfEEzlhru0PL7E8ew tSYYEvFnPIy08SDq+V6uFGSX2vIgkQ5ZkgCr/v8p2rpn2I7HTV/3s9jd58WAFekehHxH zrY4cZI+gUCbEjj6B605zytsCZeduZcgThtJxu4wDWpZgV8+i4pfejpJ2FljTNseCzq0 PVmAKRzwQ0+2WE8zjR6IIHCZLixMtleqkbDGVNYQECELi23um/ej1ag22BOCCtMLUehP 7B6WcIzIZjuYqmOwp9FxB+x5nHxOERcSz5L+1Kv2FhN7TQegnWzGgR8mXdMDCpIrbrN5 kHjg== X-Gm-Message-State: AAQBX9fae8BqU00f8O6fl531lZQ1TbqLlVYUetUFCBfsSt5bxqZhsVaS clso0dgd/mA8uhyZY+wfWgzlUw== X-Received: by 2002:a5d:66ca:0:b0:2fa:6e37:3d97 with SMTP id k10-20020a5d66ca000000b002fa6e373d97mr4382802wrw.54.1681914426881; Wed, 19 Apr 2023 07:27:06 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id h16-20020a05600c351000b003eddc6aa5fasm2392223wmq.39.2023.04.19.07.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:27:06 -0700 (PDT) Date: Wed, 19 Apr 2023 17:27:03 +0300 From: Dan Carpenter To: Richard Gong Cc: Dinh Nguyen , Alan Tull , Greg Kroah-Hartman , Richard Gong , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe Message-ID: <5f9a8cb4-5a4f-460b-9cdc-2fae6c5b7922@kili.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The svc_create_memory_pool() function returns error pointers. It never returns NULL. Fix the check. Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver") Signed-off-by: Dan Carpenter --- drivers/firmware/stratix10-svc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c index bde1f543f529..80f4e2d14e04 100644 --- a/drivers/firmware/stratix10-svc.c +++ b/drivers/firmware/stratix10-svc.c @@ -1133,8 +1133,8 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) return ret; genpool = svc_create_memory_pool(pdev, sh_memory); - if (!genpool) - return -ENOMEM; + if (IS_ERR(genpool)) + return PTR_ERR(genpool); /* allocate service controller and supporting channel */ controller = devm_kzalloc(dev, sizeof(*controller), GFP_KERNEL); -- 2.39.2