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>
 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";
 
        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));
 }