From: Eero Nurkkala <eero.nurkkala@xxxxxxxxxx> kzalloc() may fail, which can result in memory corruption later in the code. Signed-off-by: Eero Nurkkala <eero.nurkkala@xxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html