提交 c36d54ab 编写于 作者: P Pete Zaitcev 提交者: Greg Kroah-Hartman

usbmon: Smooth the core code

Two things:
 - mbus can be NULL (in case of bus removal while reader is reading)
 - Remove a useless assignment
Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 cdd5a8fd
...@@ -148,18 +148,8 @@ static void mon_complete(struct usb_bus *ubus, struct urb *urb) ...@@ -148,18 +148,8 @@ static void mon_complete(struct usb_bus *ubus, struct urb *urb)
{ {
struct mon_bus *mbus; struct mon_bus *mbus;
mbus = ubus->mon_bus; if ((mbus = ubus->mon_bus) != NULL)
if (mbus == NULL) { mon_bus_complete(mbus, urb);
/*
* 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);
mon_bus_complete(&mon_bus0, urb); mon_bus_complete(&mon_bus0, urb);
} }
...@@ -170,7 +160,7 @@ static void mon_complete(struct usb_bus *ubus, struct urb *urb) ...@@ -170,7 +160,7 @@ static void mon_complete(struct usb_bus *ubus, struct urb *urb)
*/ */
static void mon_stop(struct mon_bus *mbus) static void mon_stop(struct mon_bus *mbus)
{ {
struct usb_bus *ubus = mbus->u_bus; struct usb_bus *ubus;
struct list_head *p; struct list_head *p;
if (mbus == &mon_bus0) { if (mbus == &mon_bus0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册