* [PATCH] block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs
@ 2021-10-12 8:44 Dan Carpenter
2021-10-12 9:08 ` Gioh Kim
2021-10-12 16:40 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-10-12 8:44 UTC (permalink / raw)
To: Md. Haris Iqbal, Gioh Kim, Jack Wang
Cc: Jens Axboe, Jason Gunthorpe, Leon Romanovsky, Bart Van Assche,
Danil Kipnis, linux-block, kernel-janitors
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>
---
drivers/block/rnbd/rnbd-clt-sysfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c
index 4b93fd83bf79..44e45af00e83 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)
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs
2021-10-12 8:44 [PATCH] block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs Dan Carpenter
@ 2021-10-12 9:08 ` Gioh Kim
2021-10-12 16:40 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Gioh Kim @ 2021-10-12 9:08 UTC (permalink / raw)
To: Dan Carpenter
Cc: Md. Haris Iqbal, Gioh Kim, Jack Wang, Jens Axboe,
Jason Gunthorpe, Leon Romanovsky, Bart Van Assche, Danil Kipnis,
linux-block, kernel-janitors
On Tue, Oct 12, 2021 at 10:45 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> 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>
> ---
> drivers/block/rnbd/rnbd-clt-sysfs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c
> index 4b93fd83bf79..44e45af00e83 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)
> --
> 2.20.1
>
Thank you.
Acked-by: Gioh Kim <gi-oh.kim@ionos.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs
2021-10-12 8:44 [PATCH] block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs Dan Carpenter
2021-10-12 9:08 ` Gioh Kim
@ 2021-10-12 16:40 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-10-12 16:40 UTC (permalink / raw)
To: Dan Carpenter, Md. Haris Iqbal, Gioh Kim, Jack Wang
Cc: Jason Gunthorpe, Leon Romanovsky, Bart Van Assche, Danil Kipnis,
linux-block, kernel-janitors
On 10/12/21 2:44 AM, Dan Carpenter wrote:
> These variables are printed on the error path if match_int() fails so
> they have to be initialized.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-12 16:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 8:44 [PATCH] block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs Dan Carpenter
2021-10-12 9:08 ` Gioh Kim
2021-10-12 16:40 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).