Skip to content

Commit

Permalink
[PATCH] coverity: fix fbsysfs null pointer check
Browse files Browse the repository at this point in the history
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 <zkambarov@coverity.com>
Cc: <linux-fbdev-devel@lists.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
KAMBAROV, ZAUR authored and Linus Torvalds committed Jul 8, 2005
1 parent 5bbcfd9 commit 8f96c95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/fbsysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 8f96c95

Please sign in to comment.