Commit c62143fd authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] DAC960 Stanford Checker fix

Patch from Dave Olien <dmo@osdl.org>

This was found by the Standford Checker.
The LogicalDeviceNumber bad range test was changed from > to >=
I also replaced a couple of panic() calls with error messages,
since panic-ing seemed a little extreme.
parent 2ac28750
......@@ -1731,12 +1731,17 @@ static boolean DAC960_V2_ReadControllerConfiguration(DAC960_Controller_T
if (!DAC960_V2_NewLogicalDeviceInfo(Controller, LogicalDeviceNumber))
break;
LogicalDeviceNumber = NewLogicalDeviceInfo->LogicalDeviceNumber;
if (LogicalDeviceNumber > DAC960_MaxLogicalDrives)
panic("DAC960: Logical Drive Number %d not supported\n",
LogicalDeviceNumber);
if (NewLogicalDeviceInfo->DeviceBlockSizeInBytes != DAC960_BlockSize)
panic("DAC960: Logical Drive Block Size %d not supported\n",
NewLogicalDeviceInfo->DeviceBlockSizeInBytes);
if (LogicalDeviceNumber >= DAC960_MaxLogicalDrives) {
DAC960_Error("DAC960: Logical Drive Number %d not supported\n",
Controller, LogicalDeviceNumber);
break;
}
if (NewLogicalDeviceInfo->DeviceBlockSizeInBytes != DAC960_BlockSize) {
DAC960_Error("DAC960: Logical Drive Block Size %d not supported\n",
Controller, NewLogicalDeviceInfo->DeviceBlockSizeInBytes);
LogicalDeviceNumber++;
continue;
}
PhysicalDevice.Controller = 0;
PhysicalDevice.Channel = NewLogicalDeviceInfo->Channel;
PhysicalDevice.TargetID = NewLogicalDeviceInfo->TargetID;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment