Messages in this thread Patch in this message | | | Date | Fri, 15 Aug 2003 10:21:30 -0700 | From | Dave Olien <> | 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/
| |