Skip to content

Commit e895fed

Browse files
bvanasscheChristoph Hellwig
authored andcommitted
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: 3b6592f ("nvme: utilize two queue maps, one for reads and one for writes") # v5.0-rc1 Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent a467fc5 commit e895fed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/nvme/host/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ static int queue_count_set(const char *val, const struct kernel_param *kp)
157157
int n = 0, ret;
158158

159159
ret = kstrtoint(val, 10, &n);
160+
if (ret)
161+
return ret;
160162
if (n > num_possible_cpus())
161163
n = num_possible_cpus();
162164

0 commit comments

Comments
 (0)