diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2009-02-09 16:51:38 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 21:53:52 (GMT) |
commit | 979200719d35934367bbf97d9b7d22d5b5281dda (patch) | |
tree | 11e9cced49405fc32e259978a290e8679aab226e /drivers | |
parent | 56d92c60e6dc708541711e9de4993e7d527d08e8 (diff) | |
download | linux-fsl-qoriq-979200719d35934367bbf97d9b7d22d5b5281dda.tar.xz |
Staging: comedi: comedi_open: Fix null pointer dereference.
This can happen if other minor devices are used.
From: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: David Schleef <ds@schleef.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 6867b09..fa5ef2e 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -1760,7 +1760,8 @@ static int comedi_open(struct inode *inode, struct file *file) const unsigned minor = iminor(inode); struct comedi_device_file_info *dev_file_info = comedi_get_device_file_info(minor); - comedi_device *dev = dev_file_info->device; + comedi_device *dev = dev_file_info ? dev_file_info->device : NULL; + if (dev == NULL) { DPRINTK("invalid minor number\n"); return -ENODEV; |