提交 11f80ddf 编写于 作者: G Güngör Erseymen 提交者: Greg Kroah-Hartman

staging: comedi: remove 'bc.subdevice < 0' check in do_bufconfig_ioctl()

Type of variable 'bc' is struct comedi_bufconfig and 'subdevice' is
defined as unsigned, so there is no need to check if it is less then
zero.
Signed-off-by: NGüngör Erseymen <gelurine@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 fa45f2c7
...@@ -660,7 +660,7 @@ static int do_bufconfig_ioctl(struct comedi_device *dev, ...@@ -660,7 +660,7 @@ static int do_bufconfig_ioctl(struct comedi_device *dev,
if (copy_from_user(&bc, arg, sizeof(bc))) if (copy_from_user(&bc, arg, sizeof(bc)))
return -EFAULT; return -EFAULT;
if (bc.subdevice >= dev->n_subdevices || bc.subdevice < 0) if (bc.subdevice >= dev->n_subdevices)
return -EINVAL; return -EINVAL;
s = &dev->subdevices[bc.subdevice]; s = &dev->subdevices[bc.subdevice];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册