All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rnbd: fix uninitialized variable
@ 2020-08-24 19:43 Tong Zhang
  2020-08-24 19:45 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Tong Zhang @ 2020-08-24 19:43 UTC (permalink / raw)
  To: danil.kipnis, jinpu.wang, axboe, linux-block, linux-kernel; +Cc: ztong0001

variable err is uninitialized when bio is an error code

Signed-off-by: Tong Zhang <ztong0001@gmail.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..818eff323825 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 = bio
 		goto sess_dev_put;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-24 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-24 19:43 [PATCH] rnbd: fix uninitialized variable Tong Zhang
2020-08-24 19:45 ` Jens Axboe
2020-08-24 19:46   ` Tong Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.