From: Omar Sandoval <osandov@osandov.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Josef Bacik <jbacik@fb.com>,
linux-block@vger.kernel.org, nbd@other.debian.org,
linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: Re: [PATCH] nbd: fix return value in error handling path
Date: Mon, 26 Feb 2018 15:01:33 -0800 [thread overview]
Message-ID: <20180226230133.GA12208@vader.DHCP.thefacebook.com> (raw)
In-Reply-To: <20180212171450.GA31668@embeddedgus>
On Mon, Feb 12, 2018 at 11:14:55AM -0600, Gustavo A. R. Silva wrote:
> It seems that the proper value to return in this particular case is the
> one contained into variable new_index instead of ret.
>
> Addresses-Coverity-ID: 1465148 ("Copy-paste error")
> Fixes: e46c7287b1c2 ("nbd: add a basic netlink interface")
Reviewed-by: Omar Sandoval <osandov@fb.com>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> drivers/block/nbd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index 5f2a424..86258b0 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -1591,7 +1591,7 @@ static int nbd_genl_connect(struct sk_buff *skb, struct genl_info *info)
> if (new_index < 0) {
> mutex_unlock(&nbd_index_mutex);
> printk(KERN_ERR "nbd: failed to add new device\n");
> - return ret;
> + return new_index;
> }
> nbd = idr_find(&nbd_index_idr, new_index);
> }
> --
> 2.7.4
>
next prev parent reply other threads:[~2018-02-26 23:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 17:14 [PATCH] nbd: fix return value in error handling path Gustavo A. R. Silva
2018-02-26 23:01 ` Omar Sandoval [this message]
2018-02-27 21:43 ` Gustavo A. R. Silva
2018-02-27 22:51 ` Jens Axboe
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=20180226230133.GA12208@vader.DHCP.thefacebook.com \
--to=osandov@osandov.com \
--cc=garsilva@embeddedor.com \
--cc=gustavo@embeddedor.com \
--cc=jbacik@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@other.debian.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