From: Fabio Estevam Date: Wed, 9 Sep 2015 22:39:15 +0000 (-0700) Subject: lib/decompress_unlzma: Do a NULL check for pointer X-Git-Tag: v4.14-rc1~4703^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4e29dc4841d21943bec1bc5378ab421d2320d83;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c index decb646..ed7a1fd 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, 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++)