Skip to content

Commit

Permalink
usb: gadget: u_uac1: NULL dereference on error path
Browse files Browse the repository at this point in the history
We should return here with an error code instead of continuing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Dan Carpenter authored and Felipe Balbi committed Mar 4, 2013
1 parent fddedd8 commit 29240e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/gadget/u_uac1.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,11 @@ static int gaudio_open_snd_dev(struct gaudio *card)
snd = &card->playback;
snd->filp = filp_open(fn_play, O_WRONLY, 0);
if (IS_ERR(snd->filp)) {
int ret = PTR_ERR(snd->filp);

ERROR(card, "No such PCM playback device: %s\n", fn_play);
snd->filp = NULL;
return ret;
}
pcm_file = snd->filp->private_data;
snd->substream = pcm_file->substream;
Expand Down

0 comments on commit 29240e2

Please sign in to comment.