nvme-pci: check kstrtoint() return value in queue_count_set()
authorBart Van Assche <[email protected]>
Thu, 14 Feb 2019 22:50:54 +0000 (14:50 -0800)
committerChristoph Hellwig <[email protected]>
Wed, 20 Feb 2019 14:18:07 +0000 (07:18 -0700)
This patch avoids that the compiler complains about 'ret' being set
but not being used when building with W=1.

Fixes: 3b6592f70ad7 ("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]>
drivers/nvme/host/pci.c

index 022ea1ee63f8d1998f8f7deaf75470e344a66a06..84ed1bbce86b8c456b60517bf23c4d566e93c964 100644 (file)
@@ -157,6 +157,8 @@ static int queue_count_set(const char *val, const struct kernel_param *kp)
        int n = 0, ret;
 
        ret = kstrtoint(val, 10, &n);
+       if (ret)
+               return ret;
        if (n > num_possible_cpus())
                n = num_possible_cpus();