mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 00:48:50 +00:00
53ed2ac8fc
In an entirely unrelated discussion where I pointed out a stupid thinko of mine, Rasmus piped up and noted that that obvious mistake already existed elsewhere in the kernel tree. An "error pointer" is the negative error value encoded as a pointer, making the whole "return error or valid pointer" use-case simple and straightforward. We use it all over the kernel. But the key here is that errors are _negative_ error numbers, not the horrid UNIX user-level model of "-1 and the value of 'errno'". The Apple mailbox driver used the positive error values, and thus just returned invalid normal pointers instead of actual errors. Of course, the reason nobody ever noticed is that the errors presumably never actually happen, so this is fixing a conceptual bug rather than an actual one. Reported-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Link: https://lore.kernel.org/all/5c30afe0-f9fb-45d5-9333-dd914a1ea93a@prevas.dk/ Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
amlogic | ||
apple | ||
aspeed | ||
atmel | ||
bcm | ||
canaan | ||
dove | ||
fsl | ||
fujitsu | ||
gemini | ||
hisilicon | ||
imx | ||
ixp4xx | ||
lantiq | ||
litex | ||
loongson | ||
mediatek | ||
microchip | ||
nuvoton | ||
pxa | ||
qcom | ||
renesas | ||
rockchip | ||
samsung | ||
sunxi | ||
tegra | ||
ti | ||
ux500 | ||
versatile | ||
xilinx | ||
Kconfig | ||
Makefile |