From 7b1a5e2f4f5afde4f1dadf58223c2f293208293b Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCng=C3=B6r=20Erseymen?= Date: Fri, 7 Jun 2013 21:29:50 +0300 Subject: [PATCH] staging: comedi: remove 'bi.subdevice < 0' check in do_bufinfo_ioctl() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Type of variable 'bi' is struct comedi_bufinfo and 'subdevice' is defined as unsigned, so there is no need to check if it is less then zero. Signed-off-by: Güngör Erseymen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/comedi_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 986f19572689..c561a0eda92a 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -913,7 +913,7 @@ static int do_bufinfo_ioctl(struct comedi_device *dev, if (copy_from_user(&bi, arg, sizeof(bi))) return -EFAULT; - if (bi.subdevice >= dev->n_subdevices || bi.subdevice < 0) + if (bi.subdevice >= dev->n_subdevices) return -EINVAL; s = &dev->subdevices[bi.subdevice]; -- 2.39.5