* [PATCH] DAC960 fix for NULL dereference in open()
@ 2003-08-15 17:21 Dave Olien
0 siblings, 0 replies; only message in thread
From: Dave Olien @ 2003-08-15 17:21 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
This patch fixes a problem that's been hidden for a while. DAC960_open()
will try to dereference a NULL pointer if an application opens
(for example) /dev/rd/c0d12 when there has never been a logical device
created for that file.
diff -ur linux-2.6.0-test3_mm2_original/drivers/block/DAC960.c linux-2.6.0-test3_mm2_DAC/drivers/block/DAC960.c
--- linux-2.6.0-test3_mm2_original/drivers/block/DAC960.c 2003-08-14 14:38:49.000000000 -0700
+++ linux-2.6.0-test3_mm2_DAC/drivers/block/DAC960.c 2003-08-15 09:39:48.000000000 -0700
@@ -82,7 +82,7 @@
} else {
DAC960_V2_LogicalDeviceInfo_T *i =
p->V2.LogicalDeviceInformation[drive_nr];
- if (i->LogicalDeviceState == DAC960_V2_LogicalDevice_Offline)
+ if (!i || i->LogicalDeviceState == DAC960_V2_LogicalDevice_Offline)
return -ENXIO;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-08-15 17:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-15 17:21 [PATCH] DAC960 fix for NULL dereference in open() Dave Olien
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).