diff options
author | Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | 2007-05-30 07:42:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:29:45 -0400 |
commit | f6ace2c99afefb7969ccccba2fb413ad29ab2e2e (patch) | |
tree | e8c2a22f2f2c6f2d8aec6ae6b06e623c4b686ec9 /drivers/usb/host/r8a66597-hcd.c | |
parent | 5d3043586db428b5b4b3df89fa0c2db9731e934c (diff) |
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: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/r8a66597-hcd.c')
-rw-r--r-- | drivers/usb/host/r8a66597-hcd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index af13f1f2296a..a7a7070c6e2a 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -47,7 +47,7 @@ MODULE_DESCRIPTION("R8A66597 USB Host Controller Driver"); | |||
47 | MODULE_LICENSE("GPL"); | 47 | MODULE_LICENSE("GPL"); |
48 | MODULE_AUTHOR("Yoshihiro Shimoda"); | 48 | MODULE_AUTHOR("Yoshihiro Shimoda"); |
49 | 49 | ||
50 | #define DRIVER_VERSION "9 May 2007" | 50 | #define DRIVER_VERSION "29 May 2007" |
51 | 51 | ||
52 | static const char hcd_name[] = "r8a66597_hcd"; | 52 | static const char hcd_name[] = "r8a66597_hcd"; |
53 | 53 | ||
@@ -544,6 +544,9 @@ static void pipe_toggle_restore(struct r8a66597 *r8a66597, | |||
544 | unsigned char endpoint = usb_pipeendpoint(urb->pipe); | 544 | unsigned char endpoint = usb_pipeendpoint(urb->pipe); |
545 | unsigned short *toggle = get_toggle_pointer(dev, urb->pipe); | 545 | unsigned short *toggle = get_toggle_pointer(dev, urb->pipe); |
546 | 546 | ||
547 | if (!toggle) | ||
548 | return; | ||
549 | |||
547 | r8a66597_pipe_toggle(r8a66597, pipe, *toggle & (1 << endpoint)); | 550 | r8a66597_pipe_toggle(r8a66597, pipe, *toggle & (1 << endpoint)); |
548 | } | 551 | } |
549 | 552 | ||