drm/ttm: callback move_notify any time bo placement

Dan Carpenter dan.carpenter at oracle.com
Wed Dec 7 01:02:48 PST 2011


change v4

Hello Jerome Glisse,

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

The patch dc97b3409a79: "drm/ttm: callback move_notify any time bo 
placement change v4" from Nov 18, 2011, leads to the following Smatch 
complaint:

drivers/gpu/drm/nouveau/nouveau_bo.c +818 nouveau_bo_move_ntfy()
	 warn: variable dereferenced before check 'new_mem' (see line 813)

drivers/gpu/drm/nouveau/nouveau_bo.c
   812	{
   813		struct nouveau_mem *node = new_mem->mm_node;
                                           ^^^^^^^^^^^^^^^^
Old dereference.  new_mem can be NULL here these days.

   814		struct nouveau_bo *nvbo = nouveau_bo(bo);
   815		struct nouveau_vma *vma;
   816	
   817		list_for_each_entry(vma, &nvbo->vma_list, head) {
   818			if (new_mem && new_mem->mem_type == TTM_PL_VRAM) {
                            ^^^^^^^
new check.

   819				nouveau_vm_map(vma, new_mem->mm_node);
   820			} else

regards,
dan carpenter



More information about the dri-devel mailing list