lkml.org 
[lkml]   [2003]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] DAC960 Stanford Checker fix


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.

---------------------------------------------------------------------------

diff -ur linux-2.5.59_original/drivers/block/DAC960.c linux-2.5.59_DAC_Logical_Dev/drivers/block/DAC960.c
--- linux-2.5.59_original/drivers/block/DAC960.c 2003-01-16 18:22:28.000000000 -0800
+++ linux-2.5.59_DAC_Logical_Dev/drivers/block/DAC960.c 2003-01-28 16:36:02.000000000 -0800
@@ -1729,12 +1729,17 @@
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;

-
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:33    [W:0.036 / U:7.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site