Skip to content

Commit

Permalink
[SCSI] qla2xxx: don't free pool that wasn't allocated
Browse files Browse the repository at this point in the history
In the original code, if dma_pool_alloc() fails then we call
dma_pool_free().  It causes an error, possibly a NULL dereference.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Dan Carpenter authored and James Bottomley committed May 22, 2012
1 parent 83ff74e commit 841f97b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/qla2xxx/qla_iocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ qla82xx_start_scsi(srb_t *sp)
if (!ctx->fcp_cmnd) {
ql_log(ql_log_fatal, vha, 0x3011,
"Failed to allocate fcp_cmnd for cmd=%p.\n", cmd);
goto queuing_error_fcp_cmnd;
goto queuing_error;
}

/* Initialize the DSD list and dma handle */
Expand Down

0 comments on commit 841f97b

Please sign in to comment.