Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26665
b: refs/heads/master
c: 77ef6c4
h: refs/heads/master
i:
  26663: 8801063
v: v3
  • Loading branch information
Pete Zaitcev authored and Greg Kroah-Hartman committed May 9, 2006
1 parent 95f6112 commit 72ede1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 436f5762bcd4929825a0725d4bc78337e6fc0d8f
refs/heads/master: 77ef6c4d6e23653a79eedacdd6d1d0da7083e59c
18 changes: 10 additions & 8 deletions trunk/drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ static void ub_cleanup(struct ub_dev *sc)
kfree(lun);
}

usb_set_intfdata(sc->intf, NULL);
usb_put_intf(sc->intf);
usb_put_dev(sc->dev);
kfree(sc);
}

Expand Down Expand Up @@ -2221,7 +2224,12 @@ static int ub_probe(struct usb_interface *intf,
// sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
usb_set_intfdata(intf, sc);
usb_get_dev(sc->dev);
// usb_get_intf(sc->intf); /* Do we need this? */
/*
* Since we give the interface struct to the block level through
* disk->driverfs_dev, we have to pin it. Otherwise, block_uevent
* oopses on close after a disconnect (kernels 2.6.16 and up).
*/
usb_get_intf(sc->intf);

snprintf(sc->name, 12, DRV_NAME "(%d.%d)",
sc->dev->bus->busnum, sc->dev->devnum);
Expand Down Expand Up @@ -2286,7 +2294,7 @@ static int ub_probe(struct usb_interface *intf,

err_dev_desc:
usb_set_intfdata(intf, NULL);
// usb_put_intf(sc->intf);
usb_put_intf(sc->intf);
usb_put_dev(sc->dev);
kfree(sc);
err_core:
Expand Down Expand Up @@ -2461,12 +2469,6 @@ static void ub_disconnect(struct usb_interface *intf)
* and no URBs left in transit.
*/

usb_set_intfdata(intf, NULL);
// usb_put_intf(sc->intf);
sc->intf = NULL;
usb_put_dev(sc->dev);
sc->dev = NULL;

ub_put(sc);
}

Expand Down

0 comments on commit 72ede1b

Please sign in to comment.