From: KAMBAROV, ZAUR Date: Fri, 8 Jul 2005 00:57:05 +0000 (-0700) Subject: [PATCH] coverity: fix fbsysfs null pointer check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8f96c95680bfe66ff00c91859d4c73edf539b854;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] coverity: fix fbsysfs null pointer check Correctly test for a null pointer before going and dereferencing it. This defect was found automatically by Coverity Prevent, a static analysis tool. Signed-off-by: Zaur Kambarov Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index 7dfbf39b4ed3..ddc9443254d9 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c @@ -256,7 +256,7 @@ static ssize_t show_cmap(struct class_device *class_device, char *buf) unsigned int offset = 0, i; if (!fb_info->cmap.red || !fb_info->cmap.blue || - fb_info->cmap.green || fb_info->cmap.transp) + !fb_info->cmap.green || !fb_info->cmap.transp) return -EINVAL; for (i = 0; i < fb_info->cmap.len; i++) {