From ef6d88e18233618cf777885a04bb2f9069dd482c Mon Sep 17 00:00:00 2001 From: Horst Schirmeier Date: Thu, 9 Mar 2006 14:10:49 +0100 Subject: [PATCH] --- yaml --- r: 22084 b: refs/heads/master c: f48219db93eaee644e9fd9f22fb6421f38059cc5 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/core/message.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 11b3e03db39c..3b92036431ba 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6aa35675bbc370e5f11baae7e01a9ab255d8030c +refs/heads/master: f48219db93eaee644e9fd9f22fb6421f38059cc5 diff --git a/trunk/drivers/usb/core/message.c b/trunk/drivers/usb/core/message.c index 2f6009b0cffc..08fb20f06f3e 100644 --- a/trunk/drivers/usb/core/message.c +++ b/trunk/drivers/usb/core/message.c @@ -1388,11 +1388,13 @@ int usb_set_configuration(struct usb_device *dev, int configuration) if (dev->state != USB_STATE_ADDRESS) usb_disable_device (dev, 1); // Skip ep0 - i = dev->bus_mA - cp->desc.bMaxPower * 2; - if (i < 0) - dev_warn(&dev->dev, "new config #%d exceeds power " - "limit by %dmA\n", - configuration, -i); + if (cp) { + i = dev->bus_mA - cp->desc.bMaxPower * 2; + if (i < 0) + dev_warn(&dev->dev, "new config #%d exceeds power " + "limit by %dmA\n", + configuration, -i); + } if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_CONFIGURATION, 0, configuration, 0,