DAC960 fix for NULL dereference in open()
PATCH 1/1 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.
drivers/block/DAC960.c +1 -1
@@ -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 ; }