All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ying Chu <jasonchu@marvell.com>
To: linux-scsi@vger.kernel.org
Cc: jeff@garzik.org, james.bottomley@hansenpartnership.com
Subject: [PATCH 1/4] mvsas: bugfix for NULL pointer execption
Date: Fri, 8 May 2009 14:15:04 +0800	[thread overview]
Message-ID: <20090508061504.GA1880@jason.marvell.com> (raw)

>From 347191384292c6e9a9a572c657049bc11615fb82 Mon Sep 17 00:00:00 2001
From: Andy <ayan@marvell.com>
Date: Mon, 4 May 2009 23:29:26 +0800
Subject: [PATCH 1/4] mvsas: bug fix, null pointer may be used

Null pointer exception when mvi_dev is null.

Signed-off-by: Ying Chu <jasonchu@marvell.com>
Signed-off-by: Andy Yan <ayan@marvell.com>
Signed-off-by: Ke Wei <kewei@marvell.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 d79ac17..318ec01 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;
 
-- 
1.6.0.3

-- 
Regards,
Ying Chu

             reply	other threads:[~2009-05-08  6:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-08  6:15 Ying Chu [this message]
2009-05-08 15:43 ` [PATCH 1/4] mvsas: bugfix for NULL pointer execption James Bottomley
2009-05-08 22:05   ` Jeff Garzik
2009-05-09  7:26     ` Andy Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090508061504.GA1880@jason.marvell.com \
    --to=jasonchu@marvell.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jeff@garzik.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.