aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorKAMBAROV, ZAUR <kambarov@berkeley.edu>2005-07-07 20:57:05 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:47 -0400
commit8f96c95680bfe66ff00c91859d4c73edf539b854 (patch)
tree306857acc1009e7d354aea71aa02a0ea5d40fefd /drivers/video
parent5bbcfd9000887c0da7d57cc7b3ac869fc0dd5aa9 (diff)
[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 <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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbsysfs.c2
1 files changed, 1 insertions, 1 deletions
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)
256 unsigned int offset = 0, i; 256 unsigned int offset = 0, i;
257 257
258 if (!fb_info->cmap.red || !fb_info->cmap.blue || 258 if (!fb_info->cmap.red || !fb_info->cmap.blue ||
259 fb_info->cmap.green || fb_info->cmap.transp) 259 !fb_info->cmap.green || !fb_info->cmap.transp)
260 return -EINVAL; 260 return -EINVAL;
261 261
262 for (i = 0; i < fb_info->cmap.len; i++) { 262 for (i = 0; i < fb_info->cmap.len; i++) {