public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5][resend 2] stex: Fix for potential invalid request
@ 2009-01-26 22:36 ed.lin
  2009-01-27 15:11 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: ed.lin @ 2009-01-26 22:36 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi

The interrupt routine is good for normal cases. However, if the firmware is 
abnormal and returns an invalid response, the driver may reuse a ccb 
structure that has already been handled. This may cause problem. Fix this by 
setting the req member to NULL. Next time we know the response is invalid and 
handle accordingly if req is NULL.

Signed-off-by: Ed Lin <ed.lin@promise.com>
---

diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index a3a18ad..6129db4 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -746,6 +746,7 @@ static void stex_mu_intr(struct st_hba *hba, u32 doorbell)
     stex_copy_data(ccb, resp, size);
   }
 
+  ccb->req = NULL;
   ccb->srb_status = resp->srb_status;
   ccb->scsi_status = resp->scsi_status;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/5][resend 2] stex: Fix for potential invalid request
  2009-01-26 22:36 [PATCH 1/5][resend 2] stex: Fix for potential invalid request ed.lin
@ 2009-01-27 15:11 ` James Bottomley
  0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2009-01-27 15:11 UTC (permalink / raw)
  To: ed.lin; +Cc: linux-scsi

On Tue, 2009-01-27 at 06:36 +0800, ed.lin wrote:
> The interrupt routine is good for normal cases. However, if the firmware is 
> abnormal and returns an invalid response, the driver may reuse a ccb 
> structure that has already been handled. This may cause problem. Fix this by 
> setting the req member to NULL. Next time we know the response is invalid and 
> handle accordingly if req is NULL.
> 
> Signed-off-by: Ed Lin <ed.lin@promise.com>
> ---
> 
> diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
> index a3a18ad..6129db4 100644
> --- a/drivers/scsi/stex.c
> +++ b/drivers/scsi/stex.c
> @@ -746,6 +746,7 @@ static void stex_mu_intr(struct st_hba *hba, u32 doorbell)
>      stex_copy_data(ccb, resp, size);
>    }
>  
> +  ccb->req = NULL;
^^^^^^^^

I'm afraid all the tabs have been converted to single spaces in this
one.

Just mime attach the patches ... we can play the tune the email client
game later.

James



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-27 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 22:36 [PATCH 1/5][resend 2] stex: Fix for potential invalid request ed.lin
2009-01-27 15:11 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox