[SCSI] mvsas: bug fix, null pointer may be used

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, June 12, 2009 - 11:02 am

Gitweb:     http://git.kernel.org/linus/0f980a871678b7ec143fcb45b31bf9234e4585c8
Commit:     0f980a871678b7ec143fcb45b31bf9234e4585c8
Parent:     0b84b7094e87769120def1e703b8b4d037281038
Author:     Andy Yan <ayan@marvell.com>
AuthorDate: Mon May 11 21:49:52 2009 +0800
Committer:  James Bottomley <James.Bottomley@HansenPartnership.com>
CommitDate: Sat May 23 15:44:08 2009 -0500

    [SCSI] mvsas: bug fix, null pointer may be used
    
    Null pointer check to avoid corruption.
    
    Signed-off-by: Ying Chu <jasonchu@marvell.com>
    Signed-off-by: Andy Yan <ayan@marvell.com>
    Signed-off-by: Ke Wei <kewei@marvell.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 drivers/scsi/mvsas/mv_sas.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index 4279b5e..3fc396f 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;
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[SCSI] mvsas: bug fix, null pointer may be used, Linux Kernel Mailing ..., (Fri Jun 12, 11:02 am)