* [PATCH] Minor misc SCSI tweaks
@ 2001-07-10 7:16 Tim Hockin
2001-07-10 9:47 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Tim Hockin @ 2001-07-10 7:16 UTC (permalink / raw)
To: alan, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 246 bytes --]
All,
Attached is a small patch fixing some minor misc. SCSI issues (Duncan
Laurie's work). These are against 2.4.6, for general inclusion.
Tim
--
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.com
[-- Attachment #2: scsi_misc.diff --]
[-- Type: text/plain, Size: 1868 bytes --]
diff -ruN dist-2.4.6/drivers/scsi/scsi.c cobalt-2.4.6/drivers/scsi/scsi.c
--- dist-2.4.6/drivers/scsi/scsi.c Tue Jun 12 11:06:54 2001
+++ cobalt-2.4.6/drivers/scsi/scsi.c Mon Jul 9 11:04:11 2001
@@ -82,7 +82,7 @@
#endif
/*
- static const char RCSid[] = "$Header: /vger/u4/cvs/linux/drivers/scsi/scsi.c,v 1.38 1997/01/19 23:07:18 davem Exp $";
+ static const char RCSid[] = "$Header: /home/cvs/linux-2.4/drivers/scsi/scsi.c,v 1.1.1.4 2001/05/30 01:05:04 thockin Exp $";
*/
/*
@@ -1823,6 +1823,8 @@
*/
pcount = next_scsi_host;
+ MOD_INC_USE_COUNT;
+
/* The detect routine must carefully spinunlock/spinlock if
it enables interrupts, since all interrupt handlers do
spinlock as well.
@@ -1952,8 +1954,6 @@
(scsi_init_memory_start - scsi_memory_lower_value) / 1024,
(scsi_memory_upper_value - scsi_init_memory_start) / 1024);
#endif
-
- MOD_INC_USE_COUNT;
if (out_of_space) {
scsi_unregister_host(tpnt); /* easiest way to clean up?? */
diff -ruN dist-2.4.6/drivers/scsi/sd.c cobalt-2.4.6/drivers/scsi/sd.c
--- dist-2.4.6/drivers/scsi/sd.c Tue Jun 12 11:17:17 2001
+++ cobalt-2.4.6/drivers/scsi/sd.c Mon Jul 9 11:04:11 2001
@@ -145,6 +151,9 @@
int diskinfo[4];
SDev = rscsi_disks[DEVICE_NR(dev)].device;
+ if (!SDev)
+ return -ENODEV;
+
/*
* If we are in the middle of error recovery, don't let anyone
* else try and use this device. Also, if error recovery fails, it
@@ -502,6 +515,8 @@
target = DEVICE_NR(inode->i_rdev);
SDev = rscsi_disks[target].device;
+ if (!SDev)
+ return -ENODEV;
SDev->access_count--;
@@ -734,8 +759,15 @@
*/
SRpnt = scsi_allocate_request(rscsi_disks[i].device);
+ if (!SRpnt)
+ return i;
buffer = (unsigned char *) scsi_malloc(512);
+ if (!buffer) {
+ scsi_release_request(SRpnt);
+ SRpnt = NULL;
+ return i;
+ }
spintime = 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Minor misc SCSI tweaks
2001-07-10 7:16 [PATCH] Minor misc SCSI tweaks Tim Hockin
@ 2001-07-10 9:47 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2001-07-10 9:47 UTC (permalink / raw)
To: Tim Hockin; +Cc: alan, Linux Kernel Mailing List
> Attached is a small patch fixing some minor misc. SCSI issues (Duncan
> Laurie's work). These are against 2.4.6, for general inclusion.
Please recheck against 2.4.7pre-curent. There are a lotof scsi fixups done there
and they probably deal with most of the stuff you are also patching
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-07-10 9:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-10 7:16 [PATCH] Minor misc SCSI tweaks Tim Hockin
2001-07-10 9:47 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).