From: SF Markus Elfring <elfring@users.sourceforge.net>
To: alsa-devel@alsa-project.org, Fabian Frederick <fabf@skynet.be>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] ALSA: opl3: Delete an error message for a failed memory allocation in snd_opl3_new()
Date: Sat, 12 Aug 2017 18:02:14 +0000 [thread overview]
Message-ID: <5991f20d-dbad-a916-76be-375ade7de737@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 12 Aug 2017 19:54:20 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
sound/drivers/opl3/opl3_lib.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index d5e5b4657b4b..588963d6be28 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -355,10 +355,8 @@ int snd_opl3_new(struct snd_card *card,
*ropl3 = NULL;
opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL);
- if (opl3 = NULL) {
- snd_printk(KERN_ERR "opl3: cannot allocate\n");
+ if (!opl3)
return -ENOMEM;
- }
opl3->card = card;
opl3->hardware = hardware;
--
2.14.0
next reply other threads:[~2017-08-12 18:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-12 18:02 SF Markus Elfring [this message]
2017-08-12 21:34 ` [PATCH] ALSA: opl3: Delete an error message for a failed memory allocation in snd_opl3_new() Takashi Iwai
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=5991f20d-dbad-a916-76be-375ade7de737@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=alsa-devel@alsa-project.org \
--cc=fabf@skynet.be \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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