diff options
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r-- | drivers/scsi/megaraid.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 28c9da7d4a5c..7dc62deb4087 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c | |||
@@ -4402,6 +4402,10 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) | |||
4402 | scb_t *scb; | 4402 | scb_t *scb; |
4403 | int rval; | 4403 | int rval; |
4404 | 4404 | ||
4405 | scmd = scsi_allocate_command(GFP_KERNEL); | ||
4406 | if (!scmd) | ||
4407 | return -ENOMEM; | ||
4408 | |||
4405 | /* | 4409 | /* |
4406 | * The internal commands share one command id and hence are | 4410 | * The internal commands share one command id and hence are |
4407 | * serialized. This is so because we want to reserve maximum number of | 4411 | * serialized. This is so because we want to reserve maximum number of |
@@ -4412,12 +4416,11 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) | |||
4412 | scb = &adapter->int_scb; | 4416 | scb = &adapter->int_scb; |
4413 | memset(scb, 0, sizeof(scb_t)); | 4417 | memset(scb, 0, sizeof(scb_t)); |
4414 | 4418 | ||
4415 | scmd = &adapter->int_scmd; | ||
4416 | memset(scmd, 0, sizeof(Scsi_Cmnd)); | ||
4417 | |||
4418 | sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); | 4419 | sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); |
4419 | scmd->device = sdev; | 4420 | scmd->device = sdev; |
4420 | 4421 | ||
4422 | memset(adapter->int_cdb, 0, sizeof(adapter->int_cdb)); | ||
4423 | scmd->cmnd = adapter->int_cdb; | ||
4421 | scmd->device->host = adapter->host; | 4424 | scmd->device->host = adapter->host; |
4422 | scmd->host_scribble = (void *)scb; | 4425 | scmd->host_scribble = (void *)scb; |
4423 | scmd->cmnd[0] = MEGA_INTERNAL_CMD; | 4426 | scmd->cmnd[0] = MEGA_INTERNAL_CMD; |
@@ -4456,6 +4459,8 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) | |||
4456 | 4459 | ||
4457 | mutex_unlock(&adapter->int_mtx); | 4460 | mutex_unlock(&adapter->int_mtx); |
4458 | 4461 | ||
4462 | scsi_free_command(GFP_KERNEL, scmd); | ||
4463 | |||
4459 | return rval; | 4464 | return rval; |
4460 | } | 4465 | } |
4461 | 4466 | ||