From: Dinh Nguyen <dinguyen@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>,
Richard Gong <richard.gong@intel.com>
Cc: Alan Tull <atull@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
Date: Thu, 27 Apr 2023 13:58:47 -0500 [thread overview]
Message-ID: <1fd47550-ba39-9755-e0ce-8c377cecb2c4@kernel.org> (raw)
In-Reply-To: <5f9a8cb4-5a4f-460b-9cdc-2fae6c5b7922@kili.mountain>
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 <dan.carpenter@linaro.org>
> ---
> 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 <dinguyen@kernel.org>
prev parent reply other threads:[~2023-04-27 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 14:27 Dan Carpenter
2023-04-27 18:58 ` Dinh Nguyen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1fd47550-ba39-9755-e0ce-8c377cecb2c4@kernel.org \
--to=dinguyen@kernel.org \
--cc=atull@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.gong@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®