* [PATCH 1/4] mvsas: bugfix for NULL pointer execption
@ 2009-05-08 6:15 Ying Chu
2009-05-08 15:43 ` James Bottomley
0 siblings, 1 reply; 4+ messages in thread
From: Ying Chu @ 2009-05-08 6:15 UTC (permalink / raw)
To: linux-scsi; +Cc: jeff, james.bottomley
>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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/4] mvsas: bugfix for NULL pointer execption
2009-05-08 6:15 [PATCH 1/4] mvsas: bugfix for NULL pointer execption Ying Chu
@ 2009-05-08 15:43 ` James Bottomley
2009-05-08 22:05 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2009-05-08 15:43 UTC (permalink / raw)
To: Ying Chu; +Cc: linux-scsi, jeff
On Fri, 2009-05-08 at 14:15 +0800, Ying Chu wrote:
> >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.
A little more explanation might be helpful. It looks to me that you get
this issue when you have in-flight I/O to a device we've been notified
has gone (because you NULL out lldd_dev in the removal notification
routine).
In which case, don't we have other races where this can happen, like in
mvs_I_T_nexus_reset()?
James
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/4] mvsas: bugfix for NULL pointer execption
2009-05-08 15:43 ` James Bottomley
@ 2009-05-08 22:05 ` Jeff Garzik
2009-05-09 7:26 ` Andy Yan
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2009-05-08 22:05 UTC (permalink / raw)
To: James Bottomley; +Cc: Ying Chu, linux-scsi
James Bottomley wrote:
> On Fri, 2009-05-08 at 14:15 +0800, Ying Chu wrote:
>> >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.
>
> A little more explanation might be helpful. It looks to me that you get
> this issue when you have in-flight I/O to a device we've been notified
> has gone (because you NULL out lldd_dev in the removal notification
> routine).
>
> In which case, don't we have other races where this can happen, like in
> mvs_I_T_nexus_reset()?
Agreed...
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 1/4] mvsas: bugfix for NULL pointer execption
2009-05-08 22:05 ` Jeff Garzik
@ 2009-05-09 7:26 ` Andy Yan
0 siblings, 0 replies; 4+ messages in thread
From: Andy Yan @ 2009-05-09 7:26 UTC (permalink / raw)
To: Jeff Garzik, James Bottomley; +Cc: Ying Chu, linux-scsi@vger.kernel.org
James,
This case happens with irq coming late, the device may be gone when the irq is gotten, other cases are in normal stage, lldd_dev won't be null.
Regards
Andy Yan
-----Original Message-----
From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Jeff Garzik
Sent: 2009年5月9日 6:06
To: James Bottomley
Cc: Ying Chu; linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/4] mvsas: bugfix for NULL pointer execption
James Bottomley wrote:
> On Fri, 2009-05-08 at 14:15 +0800, Ying Chu wrote:
>> >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.
>
> A little more explanation might be helpful. It looks to me that you get
> this issue when you have in-flight I/O to a device we've been notified
> has gone (because you NULL out lldd_dev in the removal notification
> routine).
>
> In which case, don't we have other races where this can happen, like in
> mvs_I_T_nexus_reset()?
Agreed...
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-09 7:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-08 6:15 [PATCH 1/4] mvsas: bugfix for NULL pointer execption Ying Chu
2009-05-08 15:43 ` James Bottomley
2009-05-08 22:05 ` Jeff Garzik
2009-05-09 7:26 ` Andy Yan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox