Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d54690fe authored by Julia Lawall's avatar Julia Lawall Committed by Russell King
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Cc: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent e5992c05
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ static void pxa_dma_init_debugfs(void)

	dbgfs_chan = kmalloc(sizeof(*dbgfs_state) * num_dma_channels,
			     GFP_KERNEL);
	if (!dbgfs_state)
	if (!dbgfs_chan)
		goto err_alloc;

	chandir = debugfs_create_dir("channels", dbgfs_root);