[PATCH 5.14 143/151] block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs

From
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date
2021-10-18 14:04:15
Also in
lkml
Reply to
Greg Kroah-Hartman, 2021-10-18
From: Dan Carpenter <redacted>

commit 7904022decc260a19dd65b56ac896387f5da6f8c upstream.

These variables are printed on the error path if match_int() fails so
they have to be initialized.

Fixes: 2958a995edc9 ("block/rnbd-clt: Support polling mode for IO latency optimization")
Fixes: 1eb54f8f5dd8 ("block/rnbd: client: sysfs interface functions")
Signed-off-by: Dan Carpenter <redacted>
Acked-by: Gioh Kim <redacted>
Link: https://lore.kernel.org/r/20211012084443.GA31472@kili (local)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/block/rnbd/rnbd-clt-sysfs.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/block/rnbd/rnbd-clt-sysfs.c
+++ b/drivers/block/rnbd/rnbd-clt-sysfs.c
@@ -71,8 +71,10 @@ static int rnbd_clt_parse_map_options(co
 	int opt_mask = 0;
 	int token;
 	int ret = -EINVAL;
-	int i, dest_port, nr_poll_queues;
+	int nr_poll_queues = 0;
+	int dest_port = 0;
 	int p_cnt = 0;
+	int i;
 
 	options = kstrdup(buf, GFP_KERNEL);
 	if (!options)

Thread (167 messages) 167 messages, 10 authors, last reply 2021-10-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help