arch/arm/plat-pxa/dma.c: correct NULL test
Test the just-allocated value for NULL rather than some other value. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,y; statement S; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ( if ((x) == NULL) S | if ( - y + x == NULL) S ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
e5992c05ff
commit
d54690fec7
|
@ -245,7 +245,7 @@ static void pxa_dma_init_debugfs(void)
|
||||||
|
|
||||||
dbgfs_chan = kmalloc(sizeof(*dbgfs_state) * num_dma_channels,
|
dbgfs_chan = kmalloc(sizeof(*dbgfs_state) * num_dma_channels,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!dbgfs_state)
|
if (!dbgfs_chan)
|
||||||
goto err_alloc;
|
goto err_alloc;
|
||||||
|
|
||||||
chandir = debugfs_create_dir("channels", dbgfs_root);
|
chandir = debugfs_create_dir("channels", dbgfs_root);
|
||||||
|
|
Loading…
Reference in New Issue