From 3984ed2886f9935c46ab1dde35011730b6ac2587 Mon Sep 17 00:00:00 2001 From: Zongdong Jiao Date: Thu, 8 Mar 2018 17:05:25 +0800 Subject: [PATCH] hdmitx: fix wrong kmalloc usage PD#161652: fix wrong kmailloc(, GFP_KERNEL) usage At timer function. System will throw [] dump_backtrace+0x0/0x1d0 [] show_stack+0x24/0x30 [] dump_stack+0x90/0xb0 [] ___might_sleep+0x14c/0x1a0 [] __might_sleep+0x5c/0x98 [] kmem_cache_alloc_trace+0x1ec/0x238 [] hdcptx_events_handle+0x45c/0x640 [] call_timer_fn+0x3c/0x1b0 [] expire_timers+0xd8/0x178 [] run_timer_softirq+0x94/0x178 [] __do_softirq+0x12c/0x344 [] irq_exit+0xa4/0xd0 [] __handle_domain_irq+0x90/0x100 [] gic_handle_irq+0x5c/0xb0 Should use GFP_ATOMIC instead. Change-Id: I70778a6e3d993d87f71be208503688286913bda1 Signed-off-by: Zongdong Jiao --- drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c index ed5c91a..5879a32 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c @@ -3081,7 +3081,7 @@ static void hdcp_ksv_print(void) unsigned int i, pos; unsigned char *tmp_buf = NULL; - tmp_buf = kmalloc(2000, GFP_KERNEL); + tmp_buf = kmalloc(2000, GFP_ATOMIC); if (!tmp_buf) return; @@ -3110,7 +3110,7 @@ static void hdcp_ksv_sha1_calc(struct hdmitx_dev *hdev) int j = 0; /* 0x165e: Page 95 */ - hdcp_mKsvListBuf = kmalloc(0x1660, GFP_KERNEL); + hdcp_mKsvListBuf = kmalloc(0x1660, GFP_ATOMIC); if (hdcp_mKsvListBuf) { /* KSV_LEN; */ list = hdmitx_rd_reg(HDMITX_DWC_HDCP_BSTATUS_0) & KSV_MSK; -- 2.7.4