Skip to content

Commit 23200a4

Browse files
arndbbebarino
authored andcommitted
clk: pxa: fix NULL pointer dereference in pxa3xx_clk_update_accr
sparse points out an embarrasing bug in an older patch of mine, which uses the register offset instead of an __iomem pointer: drivers/clk/pxa/clk-pxa3xx.c:167:9: sparse: sparse: Using plain integer as NULL pointer Unlike sparse, gcc and clang ignore this bug and fail to warn because a literal '0' is considered a valid representation of a NULL pointer. Fixes: 3c816d9 ("ARM: pxa: move clk register definitions to driver") Cc: [email protected] Reported-by: kernel test robot <[email protected]> Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 2a809dd commit 23200a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/pxa/clk-pxa3xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void pxa3xx_clk_update_accr(u32 disable, u32 enable, u32 xclkcfg, u32 mask)
164164
accr &= ~disable;
165165
accr |= enable;
166166

167-
writel(accr, ACCR);
167+
writel(accr, clk_regs + ACCR);
168168
if (xclkcfg)
169169
__asm__("mcr p14, 0, %0, c6, c0, 0\n" : : "r"(xclkcfg));
170170

0 commit comments

Comments
 (0)