public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: Don't dereference snd->filp
@ 2010-09-29 23:22 Roel Kluin
  2010-09-30  2:31 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2010-09-29 23:22 UTC (permalink / raw)
  To: David Brownell, linux-usb, Andrew Morton, LKML

Don't dereference snd->filp.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] USB: Don't dereference snd->filp
  2010-09-29 23:22 [PATCH] USB: Don't dereference snd->filp Roel Kluin
@ 2010-09-30  2:31 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2010-09-30  2:31 UTC (permalink / raw)
  To: Roel Kluin; +Cc: David Brownell, linux-usb, Andrew Morton, LKML

On Thu, Sep 30, 2010 at 01:22:36AM +0200, Roel Kluin wrote:
> Don't dereference snd->filp.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
>  drivers/usb/gadget/u_audio.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> Or should it return the error pointer?

Probably, what happens if you do?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-30  2:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-29 23:22 [PATCH] USB: Don't dereference snd->filp Roel Kluin
2010-09-30  2:31 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox