Skip to content

Commit

Permalink
usbmon: Smooth the core code
Browse files Browse the repository at this point in the history
Two things:
 - mbus can be NULL (in case of bus removal while reader is reading)
 - Remove a useless assignment

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Pete Zaitcev authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent cdd5a8f commit c36d54a
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions drivers/usb/mon/mon_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,8 @@ static void mon_complete(struct usb_bus *ubus, struct urb *urb)
{
struct mon_bus *mbus;

mbus = ubus->mon_bus;
if (mbus == NULL) {
/*
* This should not happen.
* At this point we do not even know the bus number...
*/
printk(KERN_ERR TAG ": Null mon bus in URB, address %p\n",
urb);
return;
}

mon_bus_complete(mbus, urb);
if ((mbus = ubus->mon_bus) != NULL)
mon_bus_complete(mbus, urb);
mon_bus_complete(&mon_bus0, urb);
}

Expand All @@ -170,7 +160,7 @@ static void mon_complete(struct usb_bus *ubus, struct urb *urb)
*/
static void mon_stop(struct mon_bus *mbus)
{
struct usb_bus *ubus = mbus->u_bus;
struct usb_bus *ubus;
struct list_head *p;

if (mbus == &mon_bus0) {
Expand Down

0 comments on commit c36d54a

Please sign in to comment.