[PATCH] USB: Don't dereference snd->filp

From: Roel Kluin
Date: Wed Sep 29 2010 - 17:25:33 EST


Don't dereference snd->filp.

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
drivers/usb/gadget/u_audio.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

Or should it return the error pointer?

diff --git a/drivers/usb/gadget/u_audio.c b/drivers/usb/gadget/u_audio.c
index 7a86d2c..38d0305 100644
--- a/drivers/usb/gadget/u_audio.c
+++ b/drivers/usb/gadget/u_audio.c
@@ -242,6 +242,7 @@ static int gaudio_open_snd_dev(struct gaudio *card)
if (IS_ERR(snd->filp)) {
ERROR(card, "No such PCM playback device: %s\n", fn_play);
snd->filp = NULL;
+ return 0;
}
pcm_file = snd->filp->private_data;
snd->substream = pcm_file->substream;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/