patch-1.3.11 linux/drivers/block/ide.c

Next file: linux/drivers/block/sjcd.c
Previous file: linux/drivers/block/README.sjcd
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.10/linux/drivers/block/ide.c linux/drivers/block/ide.c
@@ -1358,7 +1358,7 @@
 		sleep_on(&dev->wqueue);
 	dev->usage++;
 	restore_flags(flags);
-	if (dev->id->config & (1<<7))	/* for removeable disks */
+	if (dev->id && (dev->id->config & (1<<7)))	/* for removeable disks */
 		check_disk_change(inode->i_rdev);
 #ifdef CONFIG_BLK_DEV_IDECD
 	if (dev->type == cdrom)
@@ -1654,7 +1654,7 @@
 	if (dev->type == cdrom)
 		return cdrom_check_media_change (dev);
 #endif	/* CONFIG_BLK_DEV_IDECD */
-	if (dev->id->config & (1<<7))	/* for removeable disks */
+	if (dev->id && (dev->id->config & (1<<7))) /* for removeable disks */
 		return 1;	/* always assume it was changed */
 	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this