Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1078996rwr; Thu, 27 Apr 2023 12:02:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nWct3yho4XQNLhyYR6dl8YB1jyDHBgAZ5bHQBuxp8HmCeOkubI5LCwF6Bq+cJnB43kRDK X-Received: by 2002:a05:6a00:1905:b0:63d:3595:26db with SMTP id y5-20020a056a00190500b0063d359526dbmr3776915pfi.23.1682622149986; Thu, 27 Apr 2023 12:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682622149; cv=none; d=google.com; s=arc-20160816; b=qNdJ+sS/xkvzOROXypNuoaMKfW1NDMe/KckwqSgUM6zNAAXFAVnydda4/xPR86PxAz L+EcWq7Yt1CVqk7+Kltt7Gn5+502tSmb3ly+JdeH/T3U6ixgLjpVRCmeY3eIT2r2jEbK fL76vqM5f9EV48EJv4vUSsrc5EkC1mUkWZjbSVWJTId0L/kR4IiXpgYPm4Wd3hIuE+VB Vm6mGheI6TF9ZT8jXR2Tba4hyrHjwjt0uwTv02drOPzQZNylwX6cUYYCdIz0bJJdy3ZN gaREwnLMSTtF+BUjC/WcjROeW2ZgbzxjcT7IS92Q/WdX7LH3NpxJO2OsUSDLrhJn7UIF J8Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=lsrXitJY2FHpf0egq6PIgwc6+V/XyyciQRKcuRtVgG0=; b=Yk5iuyY6hTBv0MtuB16oH9XBj+d0ICgdNor9klgToNtxp1uPGROqhgbUJWhyZbv5gF gHvhENxvhpDeyB1anDM/7NtFOQAMwZku3xNp535r9zEuVGPUcK6tSA4DVs7voFTZJkXI 8/aUf2A3nBGbm6cHabDtDd9xAHaqADMcTJTtt3KhDSgsnowYgmw1CExKdUdhMOaWayNr xlkzXGDGPtLfYRNnl+lv2/NsKDX0z6jHS37VNt22uVMJGW7B9JseWH54hmWDd7VgBY8d I2k9h+hPwEEn6g8YrR2LA59DvtWrUVeXH/nx4pyUGFehma1nX9zihFRbXIZZ1RJWaW+6 bM7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cScbz/eR"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r6-20020aa79886000000b0063894236046si19122123pfl.330.2023.04.27.12.02.18; Thu, 27 Apr 2023 12:02:29 -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=@kernel.org header.s=k20201202 header.b="cScbz/eR"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243932AbjD0S6x (ORCPT + 99 others); Thu, 27 Apr 2023 14:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjD0S6v (ORCPT ); Thu, 27 Apr 2023 14:58:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33B8740C4; Thu, 27 Apr 2023 11:58:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C68EB63EEB; Thu, 27 Apr 2023 18:58:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 833B6C433EF; Thu, 27 Apr 2023 18:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682621930; bh=SVsj2YP3hE7lt1kgMPLknB0++p0vIzw5HpKUgiTODzk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cScbz/eRiBMpqKqFxaAvJvqmx5L/N4qkJIeM7wOPnP6GP5hT7jh7FCVez20ehZmNB mQIwInBOiEk8YBJc22sWm3/EqKpaqceG9ah7UvFbVBAwbmHlrDNQ5hzxE/OcdT/5Iw BRrFc15iVsaqUnobe/cQSKl7Pb8Fto0d+8hiZoE4PNOdT5IxzQzAoZlfE6zTB8J7xg qimPzSSGrrColVxmB7IBMqkpr1t9YQ7AxnId53iZCFXNOZK5qUn8GiqjVcRBYOiqf6 ak4+j7ZK7expzvbPww6mii4vW0e045l4Gv+Vjl8peI1u4rE9kwgqU/G+aI21oLQNUf WSNRYI4EM34Gg== Message-ID: <1fd47550-ba39-9755-e0ce-8c377cecb2c4@kernel.org> Date: Thu, 27 Apr 2023 13:58:47 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe Content-Language: en-US To: Dan Carpenter , Richard Gong Cc: Alan Tull , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <5f9a8cb4-5a4f-460b-9cdc-2fae6c5b7922@kili.mountain> From: Dinh Nguyen In-Reply-To: <5f9a8cb4-5a4f-460b-9cdc-2fae6c5b7922@kili.mountain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 4/19/23 09:27, Dan Carpenter wrote: > 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); Acked-by: Dinh Nguyen