Revision 1a07a94b47b1f528f39c3e6187b5eaf02efe44ea authored by Ondrej Jirman on 05 April 2019, 23:30:48 UTC, committed by Maxime Ripard on 08 April 2019, 08:30:23 UTC
There are two problems here:

1. Not all clk_data->hws[] need to be initialized, depending on various
   configured quirks. This leads to NULL ptr deref in
   clk_hw_unregister_gate() in sun8i_tcon_top_unbind()
2. If there is error when registering the clk_data->hws[],
   err_unregister_gates error path will try to unregister
   IS_ERR()=true (invalid) pointer.

For problem (1) I have this stack trace:

Unable to handle kernel NULL pointer dereference at virtual
  address 0000000000000008
Call trace:
 clk_hw_unregister+0x8/0x18
 clk_hw_unregister_gate+0x14/0x28
 sun8i_tcon_top_unbind+0x2c/0x60
 component_unbind.isra.4+0x2c/0x50
 component_bind_all+0x1d4/0x230
 sun4i_drv_bind+0xc4/0x1a0
 try_to_bring_up_master+0x164/0x1c0
 __component_add+0xa0/0x168
 component_add+0x10/0x18
 sun8i_dw_hdmi_probe+0x18/0x20
 platform_drv_probe+0x3c/0x70
 really_probe+0xcc/0x278
 driver_probe_device+0x34/0xa8

Problem (2) was identified by head scratching.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190405233048.3823-1-megous@megous.com
1 parent b85d00b
History
File Mode Size
ccids
Kconfig -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 878 bytes
ackvec.c -rw-r--r-- 12.4 KB
ackvec.h -rw-r--r-- 4.7 KB
ccid.c -rw-r--r-- 5.2 KB
ccid.h -rw-r--r-- 8.7 KB
dccp.h -rw-r--r-- 16.1 KB
diag.c -rw-r--r-- 2.3 KB
feat.c -rw-r--r-- 47.2 KB
feat.h -rw-r--r-- 4.6 KB
input.c -rw-r--r-- 21.9 KB
ipv4.c -rw-r--r-- 28.7 KB
ipv6.c -rw-r--r-- 30.4 KB
ipv6.h -rw-r--r-- 754 bytes
minisocks.c -rw-r--r-- 7.5 KB
options.c -rw-r--r-- 16.5 KB
output.c -rw-r--r-- 20.4 KB
proto.c -rw-r--r-- 30.3 KB
qpolicy.c -rw-r--r-- 3.4 KB
sysctl.c -rw-r--r-- 2.8 KB
timer.c -rw-r--r-- 7.3 KB
trace.h -rw-r--r-- 2.2 KB

back to top