aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-02-28 07:44:38 +0300
committerFelipe Balbi <balbi@ti.com>2013-03-04 13:16:45 +0200
commit29240e2392786c39007df2f4162f3dc4680f3dec (patch)
tree8d23c2750c32090bfc371ff83dfa590b113df401
parentfddedd8334d8b4ac6374894d5eed237d18ce1afb (diff)
downloadkernel_goldelico_gta04-29240e2392786c39007df2f4162f3dc4680f3dec.zip
kernel_goldelico_gta04-29240e2392786c39007df2f4162f3dc4680f3dec.tar.gz
kernel_goldelico_gta04-29240e2392786c39007df2f4162f3dc4680f3dec.tar.bz2
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>
-rw-r--r--drivers/usb/gadget/u_uac1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/u_uac1.c b/drivers/usb/gadget/u_uac1.c
index e0c5e88..c7d460f 100644
--- a/drivers/usb/gadget/u_uac1.c
+++ b/drivers/usb/gadget/u_uac1.c
@@ -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;