mirror of
https://github.com/torvalds/linux.git
synced 2024-11-05 11:32:04 +00:00
02ffc5f3f9
In this code, 0 is returned on failure, even though other failures return -ENOMEM or other similar values. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @a@ identifier alloc; identifier ret; constant C; expression x; @@ x = alloc(...); if (x == NULL) { <+... \(ret = -C; \| return -C; \) ...+> } @@ identifier f, a.alloc; expression ret; expression x,e1,e2,e3; @@ ret = 0 ... when != ret = e1 *x = alloc(...) ... when != ret = e2 if (x == NULL) { ... when != ret = e3 return ret; } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> |
||
---|---|---|
.. | ||
atmel | ||
au1x | ||
blackfin | ||
codecs | ||
davinci | ||
ep93xx | ||
fsl | ||
imx | ||
jz4740 | ||
kirkwood | ||
nuc900 | ||
omap | ||
pxa | ||
s3c24xx | ||
s6000 | ||
sh | ||
txx9 | ||
Kconfig | ||
Makefile | ||
soc-cache.c | ||
soc-core.c | ||
soc-dapm.c | ||
soc-jack.c | ||
soc-utils.c |