diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2015-09-09 18:39:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 16:29:01 -0400 |
commit | e4e29dc4841d21943bec1bc5378ab421d2320d83 (patch) | |
tree | 6f1d4774be452de6bf37e3c88c30c054d80bff68 /lib | |
parent | 2d3862d26e67a59340ba1cf1748196c76c5787de (diff) |
lib/decompress_unlzma: Do a NULL check for pointer
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/decompress_unlzma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c index decb64629c14..ed7a1fd819f2 100644 --- a/lib/decompress_unlzma.c +++ b/lib/decompress_unlzma.c | |||
@@ -620,7 +620,7 @@ STATIC inline int INIT unlzma(unsigned char *buf, long in_len, | |||
620 | 620 | ||
621 | num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)); | 621 | num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)); |
622 | p = (uint16_t *) large_malloc(num_probs * sizeof(*p)); | 622 | p = (uint16_t *) large_malloc(num_probs * sizeof(*p)); |
623 | if (p == 0) | 623 | if (p == NULL) |
624 | goto exit_2; | 624 | goto exit_2; |
625 | num_probs = LZMA_LITERAL + (LZMA_LIT_SIZE << (lc + lp)); | 625 | num_probs = LZMA_LITERAL + (LZMA_LIT_SIZE << (lc + lp)); |
626 | for (i = 0; i < num_probs; i++) | 626 | for (i = 0; i < num_probs; i++) |