Skip to content

Commit 29240e2

Browse files
Dan CarpenterFelipe Balbi
authored andcommitted
usb: gadget: u_uac1: NULL dereference on error path
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>
1 parent fddedd8 commit 29240e2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/usb/gadget/u_uac1.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,11 @@ static int gaudio_open_snd_dev(struct gaudio *card)
240240
snd = &card->playback;
241241
snd->filp = filp_open(fn_play, O_WRONLY, 0);
242242
if (IS_ERR(snd->filp)) {
243+
int ret = PTR_ERR(snd->filp);
244+
243245
ERROR(card, "No such PCM playback device: %s\n", fn_play);
244246
snd->filp = NULL;
247+
return ret;
245248
}
246249
pcm_file = snd->filp->private_data;
247250
snd->substream = pcm_file->substream;

0 commit comments

Comments
 (0)