Skip to content

Commit

Permalink
arch/arm/plat-pxa/dma.c: correct NULL test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Russell King committed May 1, 2010
1 parent e5992c0 commit d54690f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/plat-pxa/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d54690f

Please sign in to comment.