MLK-12240: mxc cec: Fix potential memory leak issue
authorSandor Yu <Sandor.yu@nxp.com>
Tue, 12 Jan 2016 09:30:48 +0000 (17:30 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:44 +0000 (14:49 -0500)
Fix mxc cec driver potential memory leak issue.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
drivers/mxc/hdmi-cec/mxc_hdmi-cec.c

index b89139f..75c0197 100644 (file)
@@ -158,6 +158,7 @@ void mxc_hdmi_cec_handle(u16 cec_stat)
                event->msg_len = hdmi_readb(HDMI_CEC_RX_CNT);
                if (!event->msg_len) {
                        pr_err("%s: Invalid CEC message length!\n", __func__);
+                       vfree(event);
                        return;
                }
                event->event_type = MESSAGE_TYPE_RECEIVE_SUCCESS;