lkml.org 
[lkml]   [1996]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subjectforwarded generic SCSI fixes
Date
Hi Linuxers,

some errors in the generic SCSI driver were brought to
my attention by Massimo Dal Zotto <dz@cs.unitn.it>.

Error codes were not transparently returned to the application.

Heiko

Here are the patches:
--- sg.c.or Tue May 7 14:54:25 1996
+++ sg.c Wed Jun 26 00:39:24 1996
@@ -230,7 +230,7 @@
* Now copy the result back to the user buffer.
*/
device->header.pack_len=device->header.reply_len;
- device->header.result=0;
+
if (count>=sizeof(struct sg_header))
{
memcpy_tofs(buf,&device->header,sizeof(struct sg_header));
@@ -242,7 +242,7 @@
}
}
else
- count=0;
+ count= device->header.result==0 ? 0 : -EIO;

/*
* Clean up, and release the device so that we can send another
@@ -276,12 +276,7 @@
* wrong.
*/
memcpy(device->header.sense_buffer, SCpnt->sense_buffer, sizeof(SCpnt->sense_buffer));
- if (SCpnt->sense_buffer[0])
- {
- device->header.result=EIO;
- }
- else
- device->header.result=SCpnt->result;
+ device->header.result=SCpnt->result;

/*
* Now wake up the process that is waiting for the

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.029 / U:2.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site