mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
nbd: fix return value in error handling path
[ Upstream commit0979962f54] 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:e46c7287b1("nbd: add a basic netlink interface") Reviewed-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d2e2e20bbd
commit
615bf75c46
@@ -1591,7 +1591,7 @@ again:
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user