diff mbox series

rnbd: Fix an error code in process_rdma()

Message ID 20200826113242.GC393664@mwanda (mailing list archive)
State New, archived
Headers show
Series rnbd: Fix an error code in process_rdma() | expand

Commit Message

Dan Carpenter Aug. 26, 2020, 11:32 a.m. UTC
The error code is uninitialized on this error path.

Fixes: 735d77d4fd28 ("rnbd: remove rnbd_dev_submit_io")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/block/rnbd/rnbd-srv.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Guoqing Jiang Aug. 26, 2020, 1:13 p.m. UTC | #1
On 8/26/20 13:32, Dan Carpenter wrote:
> The error code is uninitialized on this error path.
>
> Fixes: 735d77d4fd28 ("rnbd: remove rnbd_dev_submit_io")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   drivers/block/rnbd/rnbd-srv.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
> index 0fb94843a495..5b69bc56b225 100644
> --- a/drivers/block/rnbd/rnbd-srv.c
> +++ b/drivers/block/rnbd/rnbd-srv.c
> @@ -149,6 +149,7 @@ static int process_rdma(struct rtrs_srv *sess,
>   	bio = rnbd_bio_map_kern(data, sess_dev->rnbd_dev->ibd_bio_set, datalen, GFP_KERNEL);
>   	if (IS_ERR(bio)) {
>   		rnbd_srv_err(sess_dev, "Failed to generate bio, err: %ld\n", PTR_ERR(bio));
> +		err = PTR_ERR(bio);
>   		goto sess_dev_put;
>   	}
>   

Thanks for the fix, Acked-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>

Guoqing
Jens Axboe Aug. 26, 2020, 1:29 p.m. UTC | #2
On 8/26/20 5:32 AM, Dan Carpenter wrote:
> The error code is uninitialized on this error path.

The fix is in Linus's tree:

commit 17bc10300c69bd51b82983cdadafa0a7791f074e
Author: Nathan Chancellor <natechancellor@gmail.com>
Date:   Mon Aug 17 23:49:25 2020 -0700

    block/rnbd: Ensure err is always initialized in process_rdma
diff mbox series

Patch

diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index 0fb94843a495..5b69bc56b225 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -149,6 +149,7 @@  static int process_rdma(struct rtrs_srv *sess,
 	bio = rnbd_bio_map_kern(data, sess_dev->rnbd_dev->ibd_bio_set, datalen, GFP_KERNEL);
 	if (IS_ERR(bio)) {
 		rnbd_srv_err(sess_dev, "Failed to generate bio, err: %ld\n", PTR_ERR(bio));
+		err = PTR_ERR(bio);
 		goto sess_dev_put;
 	}