public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: David Brownell <dbrownell@users.sourceforge.net>,
	linux-usb@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] USB: Don't dereference snd->filp
Date: Thu, 30 Sep 2010 01:22:36 +0200	[thread overview]
Message-ID: <4CA3CA3C.4080709@gmail.com> (raw)

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;

             reply	other threads:[~2010-09-29 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29 23:22 Roel Kluin [this message]
2010-09-30  2:31 ` [PATCH] USB: Don't dereference snd->filp Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CA3CA3C.4080709@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox