Commit f6ace2c9 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Greg Kroah-Hartman

USB: r8a66597-hcd: fix NULL access

This patch fixes the problem that accesses NULL pointer
when disconnected a cable while play music with usb-speaker.
Signed-off-by: default avatarYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5d304358
...@@ -47,7 +47,7 @@ MODULE_DESCRIPTION("R8A66597 USB Host Controller Driver"); ...@@ -47,7 +47,7 @@ MODULE_DESCRIPTION("R8A66597 USB Host Controller Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Yoshihiro Shimoda"); MODULE_AUTHOR("Yoshihiro Shimoda");
#define DRIVER_VERSION "9 May 2007" #define DRIVER_VERSION "29 May 2007"
static const char hcd_name[] = "r8a66597_hcd"; static const char hcd_name[] = "r8a66597_hcd";
...@@ -544,6 +544,9 @@ static void pipe_toggle_restore(struct r8a66597 *r8a66597, ...@@ -544,6 +544,9 @@ static void pipe_toggle_restore(struct r8a66597 *r8a66597,
unsigned char endpoint = usb_pipeendpoint(urb->pipe); unsigned char endpoint = usb_pipeendpoint(urb->pipe);
unsigned short *toggle = get_toggle_pointer(dev, urb->pipe); unsigned short *toggle = get_toggle_pointer(dev, urb->pipe);
if (!toggle)
return;
r8a66597_pipe_toggle(r8a66597, pipe, *toggle & (1 << endpoint)); r8a66597_pipe_toggle(r8a66597, pipe, *toggle & (1 << endpoint));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment