[PATCH 009/149] USB: r8a66597-hcd: fix NULL access

Greg Kroah-Hartman <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
From: Yoshihiro Shimoda <[email protected]>

This patch fixes the problem that accesses NULL pointer
when disconnected a cable while play music with usb-speaker.

Signed-off-by: Yoshihiro Shimoda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 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 af13f1f..a7a7070 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");
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Yoshihiro Shimoda");
 
-#define DRIVER_VERSION	"9 May 2007"
+#define DRIVER_VERSION	"29 May 2007"
 
 static const char hcd_name[] = "r8a66597_hcd";
 
@@ -544,6 +544,9 @@ static void pipe_toggle_restore(struct r8a66597 *r8a66597,
 	unsigned char endpoint = usb_pipeendpoint(urb->pipe);
 	unsigned short *toggle = get_toggle_pointer(dev, urb->pipe);
 
+	if (!toggle)
+		return;
+
 	r8a66597_pipe_toggle(r8a66597, pipe, *toggle & (1 << endpoint));
 }
 
-- 
1.5.2.2


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.