Merge branch 'for-linus' of git://opensource.wolfsonmicro.com/regulator
[firefly-linux-kernel-4.4.55.git] / drivers / infiniband / core / ucm.c
index 08f948df8fa98aa933406172ee9e390ac3d3bc4e..b8a0b4a7811b08dcbe71c07efedc8858a551b023 100644 (file)
@@ -1122,7 +1122,7 @@ static ssize_t ib_ucm_write(struct file *filp, const char __user *buf,
        if (copy_from_user(&hdr, buf, sizeof(hdr)))
                return -EFAULT;
 
-       if (hdr.cmd < 0 || hdr.cmd >= ARRAY_SIZE(ucm_cmd_table))
+       if (hdr.cmd >= ARRAY_SIZE(ucm_cmd_table))
                return -EINVAL;
 
        if (hdr.in + sizeof(hdr) > len)