patch-2.3.48 linux/drivers/char/raw.c

Next file: linux/drivers/char/rtc.c
Previous file: linux/drivers/char/nwflash.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.47/linux/drivers/char/raw.c linux/drivers/char/raw.c
@@ -197,7 +197,12 @@
 			raw_device_bindings[minor] = 
 				bdget(kdev_t_to_nr(MKDEV(rq.block_major, rq.block_minor)));
 		} else {
-			kdev_t dev=to_kdev_t(raw_device_bindings[minor]->bd_dev);
+			kdev_t dev;
+			if (!raw_device_bindings[minor]) {
+				err = -ENODEV;
+				break;
+			}
+			dev = to_kdev_t(raw_device_bindings[minor]->bd_dev);
 			rq.block_major = MAJOR(dev);
 			rq.block_minor = MINOR(dev);
 			err = copy_to_user((void *) arg, &rq, sizeof(rq));

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)