Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 615bf75c authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Greg Kroah-Hartman
Browse files

nbd: fix return value in error handling path



[ Upstream commit 0979962f5490abe75b3e2befb07a564fa0cf631b ]

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: e46c7287 ("nbd: add a basic netlink interface")
Reviewed-by: default avatarOmar Sandoval <osandov@fb.com>
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d2e2e20b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
		}