From: Russ Weight <russell.h.weight@intel.com>
To: Zheng Yongjun <zhengyongjun3@huawei.com>, <mdf@kernel.org>,
<hao.wu@intel.com>, <yilun.xu@intel.com>,
<linux-fpga@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <trix@redhat.com>
Subject: Re: [PATCH] fpga: stratix10-soc: Fix return value check in s10_ops_write_init()
Date: Mon, 28 Nov 2022 17:26:23 -0800 [thread overview]
Message-ID: <bdb1a752-ed47-1f9f-8a71-7b85e80bd547@intel.com> (raw)
In-Reply-To: <20221126071430.19540-1-zhengyongjun3@huawei.com>
On 11/25/22 23:14, Zheng Yongjun wrote:
> In case of error, the function stratix10_svc_allocate_memory()
> returns ERR_PTR() and never returns NULL. The NULL test in the
> return value check should be replaced with IS_ERR().
>
> Fixes: e7eef1d7633a ("fpga: add intel stratix10 soc fpga manager driver")
Reviewed-by: Russ Weight <russell.h.weight@intel.com>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> drivers/fpga/stratix10-soc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c
> index 357cea58ec98..f7f01982a512 100644
> --- a/drivers/fpga/stratix10-soc.c
> +++ b/drivers/fpga/stratix10-soc.c
> @@ -213,9 +213,9 @@ static int s10_ops_write_init(struct fpga_manager *mgr,
> /* Allocate buffers from the service layer's pool. */
> for (i = 0; i < NUM_SVC_BUFS; i++) {
> kbuf = stratix10_svc_allocate_memory(priv->chan, SVC_BUF_SIZE);
> - if (!kbuf) {
> + if (IS_ERR(kbuf)) {
> s10_free_buffers(mgr);
> - ret = -ENOMEM;
> + ret = PTR_ERR(kbuf);
> goto init_done;
> }
>
> --
> 2.17.1
>
next prev parent reply other threads:[~2022-11-29 1:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-26 7:14 Zheng Yongjun
2022-11-29 1:26 ` Russ Weight [this message]
2022-12-30 2:34 ` Xu Yilun
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=bdb1a752-ed47-1f9f-8a71-7b85e80bd547@intel.com \
--to=russell.h.weight@intel.com \
--cc=hao.wu@intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
--cc=zhengyongjun3@huawei.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®