From: "Wu, Hao" <hao.wu@intel.com>
To: "Xu, Yilun" <yilun.xu@intel.com>, Tom Rix <trix@redhat.com>,
Miaoqian Lin <linmq006@gmail.com>
Cc: "linux-fpga@vger.kernel.org" <linux-fpga@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mdf@kernel.org" <mdf@kernel.org>
Subject: RE: [PATCH v2] fpga: stratix10-soc: fix NULL vs IS_ERR() checking
Date: Mon, 13 Dec 2021 06:12:38 +0000 [thread overview]
Message-ID: <DM6PR11MB3819B3918DA4D58E59228CAC85749@DM6PR11MB3819.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20211213012818.GC336280@yilunxu-OptiPlex-7050>
> > On 12/11/21 6:50 AM, Miaoqian Lin wrote:
> > > The stratix10_svc_allocate_memory function does not return NULL. It
> > > returns ERR_PTR(-ENOMEM). Use IS_ERR check the return value.
> > >
Please add "Fixes" tag, then
Acked-by: Wu Hao <hao.wu@intel.com>
Thanks for the patch.
Hao
> > > Signed-off-by: Miaoqian Lin <linmq006@gmail.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 047fd7f23706..91212bab5871 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);
> >
> > Thanks!
> >
> > Reviewed-by: Tom Rix <trix@redhat.com>
>
> Acked-by: Xu Yilun <yilun.xu@intel.com>
>
> Thanks,
> Yilun
>
> >
> > > goto init_done;
> > > }
next prev parent reply other threads:[~2021-12-13 6:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-11 13:43 [PATCH] fpga: stratix10-soc: fix NULL vs IS_ERR() checking Miaoqian Lin
2021-12-11 14:05 ` Tom Rix
2021-12-11 14:50 ` [PATCH v2] " Miaoqian Lin
2021-12-11 14:57 ` Tom Rix
2021-12-13 1:28 ` Xu Yilun
2021-12-13 6:12 ` Wu, Hao [this message]
2021-12-13 6:49 ` [PATCH v3] " Miaoqian Lin
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=DM6PR11MB3819B3918DA4D58E59228CAC85749@DM6PR11MB3819.namprd11.prod.outlook.com \
--to=hao.wu@intel.com \
--cc=linmq006@gmail.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 \
/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;
as well as URLs for NNTP newsgroup(s).