Skip to contentSkip to conversation

sbc: don't dereference sbc pointer if NULL

PATCH In review [email protected] 2 participants 2 messages Feb 17, 2009 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sbc: don't dereference sbc pointer if NULL

From: Marc-André Lureau <[email protected]>

---
 sbc/sbc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sbc/sbc.c +2 -2
index e2e7c61..a33ed57 100644
@@ -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;
Signature · 1 line
1.6.1.224.gb56c
#1 lore raw
Quoted 14 lines · On Tue, Feb 17, 2009, [email protected] wrote:
sbc/sbc.c +1 -1
index e2e7c61..a33ed57 100644
@@ -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;

sbc/sbc.c int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output, · line 1059

Quoted 8 lines
sbc/sbc.c +1 -1
@@ -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;

This one's now also pushed upstream.

Johan