Re: [PATCH] drivers/usb/core: processing failure, maching resume condition with suspend condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 1 Apr 2013, Chen Gang wrote:

> 
>   when suspend, it need check 'udev->actconfig'.
>   so when process failure, also need check it.
> 
> Signed-off-by: Chen Gang <gang.chen@xxxxxxxxxxx>
> ---
>  drivers/usb/core/driver.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
> index eb1d00a..1a50003 100644
> --- a/drivers/usb/core/driver.c
> +++ b/drivers/usb/core/driver.c
> @@ -1253,10 +1253,12 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
>  
>  	/* If the suspend failed, resume interfaces that did get suspended */
>  	if (status != 0) {
> -		msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME);
> -		while (++i < n) {
> -			intf = udev->actconfig->interface[i];
> -			usb_resume_interface(udev, intf, msg, 0);
> +		if (udev->actconfig) {
> +			msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME);
> +			while (++i < n) {
> +				intf = udev->actconfig->interface[i];
> +				usb_resume_interface(udev, intf, msg, 0);
> +			}
>  		}
>  
>  	/* If the suspend succeeded then prevent any more URB submissions

Thanks for spotting this.

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux