From: Dave Olien <dmo@osdl.org>
To: linux-kernel@vger.kernel.org
Cc: akpm@digeo.com
Subject: [PATCH] DAC960 Stanford Checker fix
Date: Thu, 6 Feb 2003 14:36:37 -0800 [thread overview]
Message-ID: <20030206223637.GA3762@osdl.org> (raw)
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;
reply other threads:[~2003-02-06 22:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030206223637.GA3762@osdl.org \
--to=dmo@osdl.org \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox