ChangeSet 1.2181.4.17, 2005/03/17 17:49:09-08:00, [EMAIL PROTECTED]
[PATCH] USB: Patch for ub to fix oops after disconnect
This patch was developed by Glenn Maynard for his oops back in December,
but for some reason I forgot about it and had it reimplemented when I stepped
on this problem myself. In my case, there was no oops, but a warning about
slab corruption.
Signed-off-by: Pete Zaitcev <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
drivers/block/ub.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff -Nru a/drivers/block/ub.c b/drivers/block/ub.c
--- a/drivers/block/ub.c 2005-03-30 13:38:59 -08:00
+++ b/drivers/block/ub.c 2005-03-30 13:38:59 -08:00
@@ -496,6 +496,11 @@
*/
static void ub_cleanup(struct ub_dev *sc)
{
+ request_queue_t *q;
+
+ /* I don't think queue can be NULL. But... Stolen from sx8.c */
+ if ((q = sc->disk->queue) != NULL)
+ blk_cleanup_queue(q);
/*
* If we zero disk->private_data BEFORE put_disk, we have to check
@@ -2056,7 +2061,6 @@
{
struct ub_dev *sc = usb_get_intfdata(intf);
struct gendisk *disk = sc->disk;
- request_queue_t *q = disk->queue;
unsigned long flags;
/*
@@ -2099,13 +2103,8 @@
*/
if (disk->flags & GENHD_FL_UP)
del_gendisk(disk);
- if (q)
- blk_cleanup_queue(q);
/*
- * We really expect blk_cleanup_queue() to wait, so no amount
- * of paranoya is too much.
- *
* Taking a lock on a structure which is about to be freed
* is very nonsensual. Here it is largely a way to do a debug freeze,
* and a bracket which shows where the nonsensual code segment ends.
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel