Skip to content

Commit

Permalink
USB: r8a66597-hcd: fix NULL access
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yoshihiro Shimoda authored and Greg Kroah-Hartman committed Jul 12, 2007
1 parent 5d30435 commit f6ace2c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/usb/host/r8a66597-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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));
}

Expand Down

0 comments on commit f6ace2c

Please sign in to comment.