[SCSI] fix sense buffer length handling problem
[pandora-kernel.git] / drivers / scsi / scsi_lib.c
index 58da7f6..72a47ce 100644 (file)
@@ -342,12 +342,12 @@ int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd,
                sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
                if (!sense)
                        return DRIVER_ERROR << 24;
-               memset(sense, 0, sizeof(*sense));
+               memset(sense, 0, SCSI_SENSE_BUFFERSIZE);
        }
        result = scsi_execute(sdev, cmd, data_direction, buffer, bufflen,
                                  sense, timeout, retries, 0);
        if (sshdr)
-               scsi_normalize_sense(sense, sizeof(*sense), sshdr);
+               scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE, sshdr);
 
        kfree(sense);
        return result;