lkml.org 
[lkml]   [2003]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] DAC960 fix for NULL dereference in open()

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;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.031 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site