Commit e895fedf authored by Bart Van Assche's avatar Bart Van Assche Committed by Christoph Hellwig

nvme-pci: check kstrtoint() return value in queue_count_set()

This patch avoids that the compiler complains about 'ret' being set
but not being used when building with W=1.

Fixes: 3b6592f7 ("nvme: utilize two queue maps, one for reads and one for writes") # v5.0-rc1
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent a467fc55
...@@ -157,6 +157,8 @@ static int queue_count_set(const char *val, const struct kernel_param *kp) ...@@ -157,6 +157,8 @@ static int queue_count_set(const char *val, const struct kernel_param *kp)
int n = 0, ret; int n = 0, ret;
ret = kstrtoint(val, 10, &n); ret = kstrtoint(val, 10, &n);
if (ret)
return ret;
if (n > num_possible_cpus()) if (n > num_possible_cpus())
n = num_possible_cpus(); n = num_possible_cpus();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment