From: Xu Yilun <yilun.xu@intel.com>
To: Russ Weight <russell.h.weight@intel.com>
Cc: Zheng Yongjun <zhengyongjun3@huawei.com>,
mdf@kernel.org, hao.wu@intel.com, linux-fpga@vger.kernel.org,
linux-kernel@vger.kernel.org, trix@redhat.com
Subject: Re: [PATCH] fpga: stratix10-soc: Fix return value check in s10_ops_write_init()
Date: Fri, 30 Dec 2022 10:34:00 +0800 [thread overview]
Message-ID: <Y65OGF4UPnjFOutm@yilunxu-OptiPlex-7050> (raw)
In-Reply-To: <bdb1a752-ed47-1f9f-8a71-7b85e80bd547@intel.com>
On 2022-11-28 at 17:26:23 -0800, Russ Weight wrote:
>
>
> 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>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Applied to for-6.2 and Cc: stable@vger.kernel.org
> > ---
> > 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
> >
>
prev parent reply other threads:[~2022-12-30 2:44 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
2022-12-30 2:34 ` Xu Yilun [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=Y65OGF4UPnjFOutm@yilunxu-OptiPlex-7050 \
--to=yilun.xu@intel.com \
--cc=hao.wu@intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=russell.h.weight@intel.com \
--cc=trix@redhat.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®