提交 8f96c956 编写于 作者: K KAMBAROV, ZAUR 提交者: Linus Torvalds

[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: NZaur Kambarov <zkambarov@coverity.com>
Cc: <linux-fbdev-devel@lists.sourceforge.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 5bbcfd90
......@@ -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++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册