History

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.

Arnd Bergmann committed 3 years ago

Commit 23200a41 parent 2a809dd1 file · +1 −1Browse files

Unified · Split

drivers/clk/pxa/clk-pxa3xx.c+1−1
@@ -164,7 +164,7 @@ void pxa3xx_clk_update_accr(u32 disable, u32 enable, u32 xclkcfg, u32 mask) · 163 unmodified lines
164 accr &= ~disable;164 accr &= ~disable;
165 accr |= enable;165 accr |= enable;
166 166
167 writel(accr, ACCR);167 writel(accr, clk_regs + ACCR);
168 if (xclkcfg)168 if (xclkcfg)
169 __asm__("mcr p14, 0, %0, c6, c0, 0\n" : : "r"(xclkcfg));169 __asm__("mcr p14, 0, %0, c6, c0, 0\n" : : "r"(xclkcfg));
170 170

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t