From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: re: drm/ttm: callback move_notify any time bo placement Date: Wed, 7 Dec 2011 12:02:48 +0300 Message-ID: <20111207090248.GA15565@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C8539E793 for ; Wed, 7 Dec 2011 01:03:02 -0800 (PST) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: jglisse@redhat.com Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org 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