From: eero.nurkkala@offcode.fi
To: linux-arm-msm@vger.kernel.org
Cc: Eero Nurkkala <eero.nurkkala@offcode.fi>
Subject: [PATCH 3/4] msm: audio: qdsp6v2: fix potential memory corruption
Date: Tue, 15 Feb 2011 14:08:40 +0200 [thread overview]
Message-ID: <1297771721-17574-3-git-send-email-eero.nurkkala@offcode.fi> (raw)
In-Reply-To: <1297771721-17574-1-git-send-email-eero.nurkkala@offcode.fi>
From: Eero Nurkkala <eero.nurkkala@offcode.fi>
kzalloc() may fail, which can result in memory corruption later
in the code.
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
---
branch: android-msm-2.6.35
arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c b/arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c
index 2d848d5..b414f3e 100644
--- a/arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c
+++ b/arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c
@@ -1028,6 +1028,11 @@ void broadcast_event(u32 evt_id, u32 dev_id, u64 session_id)
evt_payload = kzalloc(sizeof(union auddev_evt_data),
GFP_KERNEL);
+ if (!evt_payload) {
+ pr_err("%s:Out of memory\n", __func__);
+ mutex_unlock(&session_lock);
+ return;
+ }
list_for_each_entry(callback, &event.list, list) {
if (!(evt_id & callback->evt_id))
--
1.7.0.4
next prev parent reply other threads:[~2011-02-15 12:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 12:08 [PATCH 1/4] msm: audio: qdsp6v2: simplify linked lists eero.nurkkala
2011-02-15 12:08 ` [PATCH 2/4] msm: audio: qdsp6v2: remove unused mixer_post_event() eero.nurkkala
2011-02-15 12:08 ` eero.nurkkala [this message]
2011-02-15 12:08 ` [PATCH/RFC 4/4] msm: audio: qdsp6v2: simplify broadcast_event() eero.nurkkala
2011-02-16 23:58 ` Patrick Lai
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=1297771721-17574-3-git-send-email-eero.nurkkala@offcode.fi \
--to=eero.nurkkala@offcode.fi \
--cc=linux-arm-msm@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).