cciss update [4/5] fix for HP utilities

From: mikem
Date: Fri Aug 13 2004 - 17:15:13 EST


Patch 4 of 5.
This patch fixes a problem with HP utilities. If a system has
a combination of SCSI and SATA or SAS drives the utils can
become confused and return bogus info.
Applies to 2.4.27. Please consider this for inclusion.

Thanks,
mikem
-----------------------------------------------------------------------------
diff -burNp lx2427-p003/drivers/block/cciss.c lx2427/drivers/block/cciss.c
--- lx2427-p003/drivers/block/cciss.c 2004-08-13 15:49:37.062028000 -0500
+++ lx2427/drivers/block/cciss.c 2004-08-13 15:57:06.040773272 -0500
@@ -942,6 +942,8 @@ static int cciss_ioctl(struct inode *ino
{
kfree(buff);
return -EFAULT;
+ } else {
+ memset(buff, 0, iocommand.buf_size);
}
}
if ((c = cmd_alloc(h , 0)) == NULL) {
@@ -1060,12 +1062,15 @@ static int cciss_ioctl(struct inode *ino
goto cleanup1;
}
if (iocommand.Request.Type.Direction ==
- XFER_WRITE)
+ XFER_WRITE) {
/* Copy the data into the buffer created */
if (copy_from_user(buff[sg_used], data_ptr,
buff_size[sg_used])) {
status = -ENOMEM;
goto cleanup1;
+ } else {
+ memset(buff[sg_used], 0, buff_size[sg_used]);
+ }
}
size_left_alloc -= buff_size[sg_used];
data_ptr += buff_size[sg_used];
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/