Skip to content

Commit

Permalink
ALSA: usb/6fire: Fix potential NULL pointer dereference in comm.c
Browse files Browse the repository at this point in the history
'rt' was dereferenced before the NULL check.
Moved the code after the check.

Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Sachin Kamat authored and tiwai committed Nov 21, 2012
1 parent 6cf9515 commit 27b2a22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/usb/6fire/comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ int __devinit usb6fire_comm_init(struct sfire_chip *chip)
{
struct comm_runtime *rt = kzalloc(sizeof(struct comm_runtime),
GFP_KERNEL);
struct urb *urb = &rt->receiver;
struct urb *urb;
int ret;

if (!rt)
return -ENOMEM;

urb = &rt->receiver;
rt->serial = 1;
rt->chip = chip;
usb_init_urb(urb);
Expand Down

0 comments on commit 27b2a22

Please sign in to comment.