[Nouveau] [bug report] drm/nouveau/imem: convert to new-style nvkm_subdev

Dan Carpenter dan.carpenter at oracle.com
Mon Dec 12 11:59:22 UTC 2016


[ No idea why it's only complaining about this a year later... -dan ]

Hello Ben Skeggs,

This is a semi-automatic email about new static checker warnings.

The patch b7a2bc1886d0: "drm/nouveau/imem: convert to new-style 
nvkm_subdev" from Aug 20, 2015, leads to the following Smatch 
complaint:

drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:536 gk20a_instobj_new()
	 error: we previously assumed 'node' could be null (see line 532)

drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
   531						     align, &node);
   532		*pmemory = node ? &node->memory : NULL;
                           ^^^^
Added a new check for NULL.

   533		if (ret)
   534			return ret;
   535	
   536		node->imem = imem;
                ^^^^^^^^^^
Unchecked dereference.

   537	
   538		/* present memory for being mapped using small pages */

regards,
dan carpenter


More information about the Nouveau mailing list