From: Denis Kirjanov <kirjanov@gmail.com>
To: perex@perex.cz
Cc: tiwai@suse.de, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, kirjanov@gmail.com
Subject: [PATCH] check for the kzalloc return value
Date: Mon, 22 Oct 2012 17:05:53 +0400 [thread overview]
Message-ID: <1350911153-23647-1-git-send-email-kirjanov@gmail.com> (raw)
Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
---
sound/pci/als300.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 68c4469..e1f74d4 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -394,6 +394,8 @@ static int snd_als300_playback_open(struct snd_pcm_substream *substream)
struct snd_als300_substream_data *data = kzalloc(sizeof(*data),
GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
snd_als300_dbgcallenter();
chip->playback_substream = substream;
runtime->hw = snd_als300_playback_hw;
@@ -425,6 +427,8 @@ static int snd_als300_capture_open(struct snd_pcm_substream *substream)
struct snd_als300_substream_data *data = kzalloc(sizeof(*data),
GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
snd_als300_dbgcallenter();
chip->capture_substream = substream;
runtime->hw = snd_als300_capture_hw;
--
1.7.9.5
next reply other threads:[~2012-10-22 13:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-22 13:05 Denis Kirjanov [this message]
2012-10-22 14:33 ` 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=1350911153-23647-1-git-send-email-kirjanov@gmail.com \
--to=kirjanov@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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
all inboxes | Powered by JetHome®