Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29240e23 authored by Dan Carpenter's avatar Dan Carpenter Committed by Felipe Balbi
Browse files

usb: gadget: u_uac1: NULL dereference on error path



We should return here with an error code instead of continuing.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent fddedd83
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;