diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-10-24 09:21:05 +0900 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-11-05 12:40:23 -0500 |
commit | 6b0eea21efed26f92e18741e54a3121cf5cd197e (patch) | |
tree | 100893dadb93eaa0c3cf577256ab0c77d9091354 /drivers/scsi/megaraid.h | |
parent | 75fa67706cce5272bcfc51ed646f2da21f3bdb6e (diff) | |
download | op-kernel-dev-6b0eea21efed26f92e18741e54a3121cf5cd197e.zip op-kernel-dev-6b0eea21efed26f92e18741e54a3121cf5cd197e.tar.gz |
[SCSI] megaraid: fix mega_internal_command oops
scsi_cmnd->cmnd was changed from a static array to a pointer post
2.6.25. It breaks mega_internal_command():
static int
mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
{
...
scb = &adapter->int_scb;
memset(scb, 0, sizeof(scb_t));
scmd = &adapter->int_scmd;
memset(scmd, 0, sizeof(Scsi_Cmnd));
sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
scmd->device = sdev;
scmd->device->host = adapter->host;
scmd->host_scribble = (void *)scb;
scmd->cmnd[0] = MEGA_INTERNAL_CMD;
mega_internal_command() uses scsi_cmnd allocated internally so
scmd->cmnd is NULL here. This patch adds a static array for cdb to
adapter_t and uses it here. This also uses
scsi_allocate_command/scsi_free_command, the recommended way to
allocate struct scsi_cmnd since the driver might use sense_buffer in
struct scsi_cmnd.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Boaz Harrosh <bharrosh@panasas.com>
Tested-by: Pascal Terjan <pterjan@gmail.com>
Reported-by: Pascal Terjan <pterjan@gmail.com>
Acked-by: "Yang, Bo" <Bo.Yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/megaraid.h')
-rw-r--r-- | drivers/scsi/megaraid.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h index ee70bd4..795201f 100644 --- a/drivers/scsi/megaraid.h +++ b/drivers/scsi/megaraid.h @@ -888,8 +888,8 @@ typedef struct { u8 sglen; /* f/w supported scatter-gather list length */ + unsigned char int_cdb[MAX_COMMAND_SIZE]; scb_t int_scb; - Scsi_Cmnd int_scmd; struct mutex int_mtx; /* To synchronize the internal commands */ struct completion int_waitq; /* wait queue for internal |