summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorH Hartley Sweeten2015-08-10 22:14:03 +0200
committerGreg Kroah-Hartman2015-08-15 03:35:49 +0200
commit0bb6419ccf5b2548ade321d5337e9d3252a3d4a1 (patch)
treef021bdbd8fe9912155f555075c0c22c3a3b12290 /drivers/staging/comedi/comedi_fops.c
parentstaging: comedi: hwdrv_apci1564: remove magic numbers in apci1564_counter_ins... (diff)
downloadkernel-qcow2-linux-0bb6419ccf5b2548ade321d5337e9d3252a3d4a1.tar.gz
kernel-qcow2-linux-0bb6419ccf5b2548ade321d5337e9d3252a3d4a1.tar.xz
kernel-qcow2-linux-0bb6419ccf5b2548ade321d5337e9d3252a3d4a1.zip
staging: comedi: comedi_fops: remove remaining BUG_ON() checks
The BUG_ON() checks in comedi_subdevice_from_minor() and comedi_dev_get_from_subdevice_minor() are not necessary. The 'minor' numbers for a given comedi driver are setup by comedi_dev_get_from_subdevice_minor() and will always be in the correct range. Drivers should not crash the kernel, remove the BUG_ON() checks. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 4820ab6d0aa8..62526ddcb48c 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -215,7 +215,6 @@ static struct comedi_subdevice
struct comedi_subdevice *s;
unsigned int i = minor - COMEDI_NUM_BOARD_MINORS;
- BUG_ON(i >= COMEDI_NUM_SUBDEVICE_MINORS);
mutex_lock(&comedi_subdevice_minor_table_lock);
s = comedi_subdevice_minor_table[i];
if (s && s->device != dev)
@@ -241,7 +240,6 @@ static struct comedi_device *comedi_dev_get_from_subdevice_minor(unsigned minor)
struct comedi_subdevice *s;
unsigned int i = minor - COMEDI_NUM_BOARD_MINORS;
- BUG_ON(i >= COMEDI_NUM_SUBDEVICE_MINORS);
mutex_lock(&comedi_subdevice_minor_table_lock);
s = comedi_subdevice_minor_table[i];
dev = comedi_dev_get(s ? s->device : NULL);