Greg, this is an obivously correct patch for usb-storage. Please apply. Matt
----- Forwarded message from Alan Stern <[EMAIL PROTECTED]> -----
Date: Thu, 26 Sep 2002 11:25:36 -0400 (EDT)
From: Alan Stern <[EMAIL PROTECTED]>
Subject: Another (!) patch for the abort handler
To: Matthew Dharm <[EMAIL PROTECTED]>
cc: usb-storage <[EMAIL PROTECTED]>
X-Spam-Status: No, hits=-9.0 required=5.0 tests=IN_REP_TO,PLING,UNIFIED_PATCH
version=2.11
Matt:
This is a simple, obvious patch for the abort handler. I don't know how
we missed it before. Please pass it up to Greg for immediate inclusion.
Credit for this patch belongs to Yuri Per <[EMAIL PROTECTED]>.
Alan Stern
# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.819 -> 1.820
# drivers/usb/storage/transport.c 1.41 -> 1.42
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/26 [EMAIL PROTECTED] 1.820
# Fix abort problem: us->srb was used after it was erased.
#
# Thanks to Yuri Per <[EMAIL PROTECTED]> for supplying this patch.
# --------------------------------------------
#
diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
--- a/drivers/usb/storage/transport.c Thu Sep 26 11:20:53 2002
+++ b/drivers/usb/storage/transport.c Thu Sep 26 11:20:53 2002
@@ -895,6 +895,7 @@
* This must be called with scsi_lock(us->srb->host) held */
void usb_stor_abort_transport(struct us_data *us)
{
+ struct Scsi_Host *host;
int state = atomic_read(&us->sm_state);
US_DEBUGP("usb_stor_abort_transport called\n");
@@ -906,7 +907,8 @@
/* set state to abort and release the lock */
atomic_set(&us->sm_state, US_STATE_ABORTING);
- scsi_unlock(us->srb->host);
+ host = us->srb->host;
+ scsi_unlock(host);
/* If the state machine is blocked waiting for an URB or an IRQ,
* let's wake it up */
@@ -928,8 +930,8 @@
/* Wait for the aborted command to finish */
wait_for_completion(&us->notify);
- /* Reacquire the lock */
- scsi_lock(us->srb->host);
+ /* Reacquire the lock: note that us->srb is now NULL */
+ scsi_lock(host);
}
/*
----- End forwarded message -----
--
Matthew Dharm Home: [EMAIL PROTECTED]
Maintainer, Linux USB Mass Storage Driver
Why am I talking to a toilet brush?
-- CEO
User Friendly, 4/30/1998
msg08138/pgp00000.pgp
Description: PGP signature
