diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-10-12 11:44:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-10-20 11:57:58 +0200 |
commit | 9d162f541ba3fd36a571dac74b604e57323ded4a (patch) | |
tree | ec1c5a69af0e6dedf073c70119c3dbedbe016634 | |
parent | 61616be899975404df44c20ab902464b60882cd7 (diff) | |
download | linux-stable-9d162f541ba3fd36a571dac74b604e57323ded4a.tar.gz linux-stable-9d162f541ba3fd36a571dac74b604e57323ded4a.tar.bz2 linux-stable-9d162f541ba3fd36a571dac74b604e57323ded4a.zip |
block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs
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 <dan.carpenter@oracle.com>
Acked-by: Gioh Kim <gi-oh.kim@ionos.com>
Link: https://lore.kernel.org/r/20211012084443.GA31472@kili
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/block/rnbd/rnbd-clt-sysfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c index 324afdd63a96..102c08ad4dd0 100644 --- 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(const char *buf, size_t max_path_cnt, 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) |