Skip to content

Commit

Permalink
lib/decompress_unlzma: Do a NULL check for pointer
Browse files Browse the repository at this point in the history
Compare pointer-typed values to NULL rather than 0.

The semantic patch that makes this change is available
in scripts/coccinelle/null/badzero.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Fabio Estevam authored and torvalds committed Sep 10, 2015
1 parent 2d3862d commit e4e29dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/decompress_unlzma.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ STATIC inline int INIT unlzma(unsigned char *buf, long in_len,

num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp));
p = (uint16_t *) large_malloc(num_probs * sizeof(*p));
if (p == 0)
if (p == NULL)
goto exit_2;
num_probs = LZMA_LITERAL + (LZMA_LIT_SIZE << (lc + lp));
for (i = 0; i < num_probs; i++)
Expand Down

0 comments on commit e4e29dc

Please sign in to comment.