public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: marcandre.lureau@gmail.com
To: linux-bluetooth@vger.kernel.org
Cc: "Marc-André Lureau" <marc-andre.lureau@nokia.com>
Subject: [PATCH] sbc: don't dereference sbc pointer if NULL
Date: Tue, 17 Feb 2009 22:46:41 +0200	[thread overview]
Message-ID: <1234903601-7124-1-git-send-email-marcandre.lureau@gmail.com> (raw)

From: Marc-André Lureau <marc-andre.lureau@nokia.com>

---
 sbc/sbc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbc/sbc.c b/sbc/sbc.c
index e2e7c61..a33ed57 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -985,7 +985,7 @@ int sbc_decode(sbc_t *sbc, void *input, int input_len, void *output,
 	char *ptr;
 	int i, ch, framelen, samples;
 
-	if (!sbc && !input)
+	if (!sbc || !input)
 		return -EIO;
 
 	priv = sbc->priv;
@@ -1053,7 +1053,7 @@ int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output,
 			const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE],
 			int nsamples, int nchannels);
 
-	if (!sbc && !input)
+	if (!sbc || !input)
 		return -EIO;
 
 	priv = sbc->priv;
-- 
1.6.1.224.gb56c


             reply	other threads:[~2009-02-17 20:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17 20:46 marcandre.lureau [this message]
2009-02-17 21:59 ` [PATCH] sbc: don't dereference sbc pointer if NULL Johan Hedberg

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=1234903601-7124-1-git-send-email-marcandre.lureau@gmail.com \
    --to=marcandre.lureau@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marc-andre.lureau@nokia.com \
    /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