From: Ian Abbott Date: Mon, 9 Feb 2009 16:51:38 +0000 (+0000) Subject: comedi_open: Fix null pointer dereference. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9e49d96b10e0580f585a2405aa6cd1e7a17233eb;p=comedi.git comedi_open: Fix null pointer dereference. --- diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 7fc40ca1..198f4d99 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -1756,7 +1756,7 @@ 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;