From 0f980a871678b7ec143fcb45b31bf9234e4585c8 Mon Sep 17 00:00:00 2001 From: Andy Yan Date: Mon, 11 May 2009 21:49:52 +0800 Subject: [SCSI] mvsas: bug fix, null pointer may be used Null pointer check to avoid corruption. Signed-off-by: Ying Chu Signed-off-by: Andy Yan Signed-off-by: Ke Wei Signed-off-by: James Bottomley --- drivers/scsi/mvsas/mv_sas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index 4279b5e8808..3fc396fc050 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c @@ -1873,11 +1873,11 @@ int mvs_slot_complete(struct mvs_info *mvi, u32 rx_desc, u32 flags) } out: - if (mvi_dev) + if (mvi_dev) { mvi_dev->runing_req--; - if (sas_protocol_ata(task->task_proto)) - mvs_free_reg_set(mvi, mvi_dev); - + if (sas_protocol_ata(task->task_proto)) + mvs_free_reg_set(mvi, mvi_dev); + } mvs_slot_task_free(mvi, task, slot, slot_idx); sts = tstat->stat; -- cgit v1.2.3-70-g09d2