lkml.org 
[lkml]   [2020]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] block: rnbd: rnbd-srv: silence uninitialized variable warning
From
Date
On 8/18/20 1:29 AM, Nathan Chancellor wrote:
> I don't think this is a proper fix since the root cause of the warning
> appears to be that we are ignoring the return value of
> rnbd_bio_map_kern. Should we not set err to that value like this
> (completely untested)?
>
> Cheers,
> Nathan
>
> diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
> index 0fb94843a495..1b71cb2a885d 100644
> --- a/drivers/block/rnbd/rnbd-srv.c
> +++ b/drivers/block/rnbd/rnbd-srv.c
> @@ -148,7 +148,8 @@ static int process_rdma(struct rtrs_srv *sess,
> /* Generate bio with pages pointing to the rdma buffer */
> 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);
> + rnbd_srv_err(sess_dev, "Failed to generate bio, err: %ld\n", err);
> goto sess_dev_put;
> }
>
>

Ah, I see what you mean. Thanks for the fix!

Best,
Brooke Basile

\
 
 \ /
  Last update: 2020-08-18 14:45    [W:0.042 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site