lkml.org 
[lkml]   [2018]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 166/496] nbd: fix return value in error handling path
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>

    [ 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: e46c7287b1c2 ("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>
    ---
    drivers/block/nbd.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/block/nbd.c
    +++ b/drivers/block/nbd.c
    @@ -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);
    }

    \
     
     \ /
      Last update: 2018-05-28 15:24    [W:4.043 / U:1.296 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site