[Nouveau] [PATCH] nouveau: move dereferences after null checks

Marcin Slusarz marcin.slusarz at gmail.com
Sun Feb 7 12:46:35 PST 2010


On Sat, Jan 30, 2010 at 03:41:00PM +0100, Marcin Slusarz wrote:
> On Fri, Jan 29, 2010 at 12:00:49PM +0300, Dan Carpenter wrote:
> > These bugs are when code dereferences a variable and then checks that it is not null.
> > The new thing is that I wrote a shell script to try remove the false positives caused
> > by macros.  There are still some false positives because smatch is bad at handling 
> > loops and knowing when a container got redefined.
> > 
> > Sometimes the fixes are not obvious.
> > 
> > This is the output of: /path/to/smatch_scripts/filter_kernel_deref_check.sh warns.txt
> > 
> > regards,
> > dan carpenter
> > 
> > (...)
> > drivers/gpu/drm/nouveau/nouveau_object.c +891 'chan': if (!chan || !gpuobj_ret || *gpuobj_ret != NULL)
> > drivers/gpu/drm/nouveau/nouveau_sgdma.c +61 'nvbe': if (nvbe && nvbe->pages) {
> > drivers/gpu/drm/nouveau/nouveau_connector.c +91 'connector': if (!connector)
> > drivers/gpu/drm/nouveau/nv50_crtc.c +306 'crtc': if (!crtc)
> > (...)
> 
> ---
> From: Marcin Slusarz <marcin.slusarz at gmail.com>
> Subject: [PATCH] nouveau: move dereferences after null checks
> 
> Reported-by: Dan Carpenter <error27 at gmail.com>
> Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com>
> ---

ping



More information about the Nouveau mailing list