mailbox: rk3368: fix error setting if mbox_msg is null
authorXu Jianqun <jay.xu@rock-chips.com>
Thu, 4 May 2017 03:16:52 +0000 (11:16 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 8 May 2017 07:46:26 +0000 (15:46 +0800)
Fix the error dump:

[19252.682822] Unable to handle kernel NULL pointer dereference at
virtual address 00000020
[19252.682834] pgd = ffffff800935d000
[19252.682844] [00000020] *pgd=0000000077ffe003, *pud=0000000077ffe003,
*pmd=0000000000000000
[19252.682852] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[19252.682863] Modules linked in: pvrsrvkm(O)
[19252.682872] CPU: 1 PID: 59 Comm: irq/32-ff6b0000 Tainted: G        W
O    4.4.55 #34
[19252.682875] Hardware name: Rockchip rk3368 p9 board (DT)
[19252.682880] task: ffffffc074cf8c40 ti: ffffffc074d04000 task.ti:
ffffffc074d04000
[19252.682894] PC is at mbox_chan_received_data+0xc/0x20
[19252.682901] LR is at rk3368_mbox_isr+0xb0/0xd0

Change-Id: I1873d6a7e7d1390d2c2c44a77c120d1a02614fdc
Signed-off-by: Xu Jianqun <jay.xu@rock-chips.com>
drivers/mailbox/rk3368-mailbox.c

index 03f3a74d462317ef1948efa24b48199e51f51467..f006a546f51fa9424cbe5b00bfffaa081f845e4e 100644 (file)
@@ -165,7 +165,6 @@ static irqreturn_t rk3368_mbox_isr(int irq, void *dev_id)
                               msg->rx_size);
 
                mbox_chan_received_data(&mb->mbox.chans[idx], msg);
-               mb->chans[idx].msg = NULL;
 
                dev_dbg(mb->mbox.dev, "Chan[%d]: B2A message, cmd 0x%08x\n",
                        idx, msg->cmd);