netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Andrea Claudi <aclaudi@redhat.com>
Cc: linux-netdev <netdev@vger.kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH iproute2] rdma: stat: initialize ret in stat_qp_show_parse_cb()
Date: Sun, 18 Apr 2021 15:06:21 +0300	[thread overview]
Message-ID: <YHwgvbu392PVbQOh@unreal> (raw)
In-Reply-To: <CAPpH65yk95Yg7wZiNLSebNJ8=hDPff7ixNzxuXzu0yjXYu=gCA@mail.gmail.com>

On Sun, Apr 18, 2021 at 02:00:38PM +0200, Andrea Claudi wrote:
> On Sun, Apr 18, 2021 at 1:07 PM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > On Wed, Apr 14, 2021 at 12:50:57AM +0200, Andrea Claudi wrote:
> > > In the unlikely case in which the mnl_attr_for_each_nested() cycle is
> > > not executed, this function return an uninitialized value.
> > >
> > > Fix this initializing ret to 0.
> > >
> > > Fixes: 5937552b42e4 ("rdma: Add "stat qp show" support")
> > > Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
> > > ---
> > >  rdma/stat.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/rdma/stat.c b/rdma/stat.c
> > > index 75d45288..3abedae7 100644
> > > --- a/rdma/stat.c
> > > +++ b/rdma/stat.c
> > > @@ -307,7 +307,7 @@ static int stat_qp_show_parse_cb(const struct nlmsghdr *nlh, void *data)
> > >       struct rd *rd = data;
> > >       const char *name;
> > >       uint32_t idx;
> > > -     int ret;
> > > +     int ret = 0;
> >
> > It should be MNL_CB_OK which is 1 and not 0.
> >
> > Thanks.
> >
> 
> Hi Leon, and thanks for pointing this out.
> As this is already merged, I'll submit a fix.

Thanks

> 
> Regards,
> Andrea
> 
> > >
> > >       mnl_attr_parse(nlh, 0, rd_attr_cb, tb);
> > >       if (!tb[RDMA_NLDEV_ATTR_DEV_INDEX] || !tb[RDMA_NLDEV_ATTR_DEV_NAME] ||
> > > --
> > > 2.30.2
> > >
> >
> 

      reply	other threads:[~2021-04-18 12:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 22:50 [PATCH iproute2] rdma: stat: initialize ret in stat_qp_show_parse_cb() Andrea Claudi
2021-04-18 11:07 ` Leon Romanovsky
2021-04-18 12:00   ` Andrea Claudi
2021-04-18 12:06     ` Leon Romanovsky [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=YHwgvbu392PVbQOh@unreal \
    --to=leon@kernel.org \
    --cc=aclaudi@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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).