From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: re: drm/radeon: Only warn if the intra-domain offset actually exceeds the limit. Date: Thu, 29 Mar 2012 15:06:32 +0300 Message-ID: <20120329120632.GA25537@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by gabe.freedesktop.org (Postfix) with ESMTP id 007879E82A for ; Thu, 29 Mar 2012 05:06:41 -0700 (PDT) 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: michel.daenzer@amd.com Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Hello Michel D=E4nzer, This is a semi-automatic email about new static checker warnings. The patch d936622c3627: "drm/radeon: Only warn if the intra-domain = offset actually exceeds the limit." from Mar 28, 2012, leads to the = following Smatch complaint: drivers/gpu/drm/radeon/radeon_object.c:244 radeon_bo_pin_restricted() error: we previously assumed 'gpu_addr' could be null (see line 234) drivers/gpu/drm/radeon/radeon_object.c 233 bo->pin_count++; 234 if (gpu_addr) ^^^^^^^^ Old check. 235 *gpu_addr =3D radeon_bo_gpu_offset(bo); 236 = 237 if (max_offset !=3D 0) { 238 u64 domain_start; 239 = 240 if (domain =3D=3D RADEON_GEM_DOMAIN_VRAM) 241 domain_start =3D bo->rdev->mc.vram_start; 242 else 243 domain_start =3D bo->rdev->mc.gtt_start; 244 WARN_ON_ONCE((*gpu_addr - domain_start) > max_offset); ^^^^^^^^^ New dereference. 245 } 246 = regards, dan carpenter