[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 11 Nov 2017 20:23:31 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: alsa-devel@...a-project.org,
Arvind Yadav <arvind.yadav.cs@...il.com>,
Bhumika Goyal <bhumirks@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Mark Brown <broonie@...nel.org>, Takashi Iwai <tiwai@...e.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 3/3] ALSA: sgio2audio: Adjust two null pointer checks in
snd_sgio2audio_create()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 11 Nov 2017 20:10:22 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written !…
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
sound/mips/sgio2audio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
index 9e175a184b66..4027f0fc8db6 100644
--- a/sound/mips/sgio2audio.c
+++ b/sound/mips/sgio2audio.c
@@ -841,14 +841,14 @@ static int snd_sgio2audio_create(struct snd_card *card,
return -ENOENT;
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (chip == NULL)
+ if (!chip)
return -ENOMEM;
chip->card = card;
chip->ring_base = dma_alloc_coherent(NULL, MACEISA_RINGBUFFERS_SIZE,
&chip->ring_base_dma, GFP_USER);
- if (chip->ring_base == NULL) {
+ if (!chip->ring_base) {
printk(KERN_ERR
"sgio2audio: could not allocate ring buffers\n");
kfree(chip);
--
2.15.0
Powered by blists - more mailing lists