Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* coverity-fbsysfs-fix-null-pointer-check.patch added to -mm tree
@ 2005-07-01  5:53 akpm
  2005-07-01 23:53 ` James Simmons
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2005-07-01  5:53 UTC (permalink / raw)
  To: kambarov, linux-fbdev-devel, zkambarov, mm-commits


The patch titled

     coverity: fix fbsysfs null pointer check

has been added to the -mm tree.  Its filename is

     coverity-fbsysfs-fix-null-pointer-check.patch

Patches currently in -mm which might be from kambarov@berkeley.edu are

coverity-fbsysfs-fix-null-pointer-check.patch



From: "KAMBAROV, ZAUR" <kambarov@berkeley.edu>

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>
---

 drivers/video/fbsysfs.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/video/fbsysfs.c~coverity-fbsysfs-fix-null-pointer-check drivers/video/fbsysfs.c
--- devel/drivers/video/fbsysfs.c~coverity-fbsysfs-fix-null-pointer-check	2005-06-30 22:52:31.000000000 -0700
+++ devel-akpm/drivers/video/fbsysfs.c	2005-06-30 22:52:31.000000000 -0700
@@ -256,7 +256,7 @@ static ssize_t show_cmap(struct class_de
 	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++) {
_


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: coverity-fbsysfs-fix-null-pointer-check.patch added to -mm tree
  2005-07-01  5:53 coverity-fbsysfs-fix-null-pointer-check.patch added to -mm tree akpm
@ 2005-07-01 23:53 ` James Simmons
  0 siblings, 0 replies; 2+ messages in thread
From: James Simmons @ 2005-07-01 23:53 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: kambarov, zkambarov, mm-commits


Good find. I noticed a problem with transp. The transp field might or 
might not be there. That needs fixing as well.


On Thu, 30 Jun 2005 akpm@osdl.org wrote:

> 
> The patch titled
> 
>      coverity: fix fbsysfs null pointer check
> 
> has been added to the -mm tree.  Its filename is
> 
>      coverity-fbsysfs-fix-null-pointer-check.patch
> 
> Patches currently in -mm which might be from kambarov@berkeley.edu are
> 
> coverity-fbsysfs-fix-null-pointer-check.patch
> 
> 
> 
> From: "KAMBAROV, ZAUR" <kambarov@berkeley.edu>
> 
> 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>
> ---
> 
>  drivers/video/fbsysfs.c |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff -puN drivers/video/fbsysfs.c~coverity-fbsysfs-fix-null-pointer-check drivers/video/fbsysfs.c
> --- devel/drivers/video/fbsysfs.c~coverity-fbsysfs-fix-null-pointer-check	2005-06-30 22:52:31.000000000 -0700
> +++ devel-akpm/drivers/video/fbsysfs.c	2005-06-30 22:52:31.000000000 -0700
> @@ -256,7 +256,7 @@ static ssize_t show_cmap(struct class_de
>  	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++) {
> _
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Linux-fbdev-devel mailing list
> Linux-fbdev-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
> 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-01 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-01  5:53 coverity-fbsysfs-fix-null-pointer-check.patch added to -mm tree akpm
2005-07-01 23:53 ` James Simmons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox