dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* re: drm/radeon: Only warn if the intra-domain offset actually exceeds the limit.
@ 2012-03-29 12:06 Dan Carpenter
  2012-03-29 14:47 ` [PATCH] drm/radeon: Don't dereference possibly-NULL pointer Michel Dänzer
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-03-29 12:06 UTC (permalink / raw)
  To: michel.daenzer; +Cc: dri-devel

Hello Michel Dänzer,

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 = radeon_bo_gpu_offset(bo);
   236	
   237			if (max_offset != 0) {
   238				u64 domain_start;
   239	
   240				if (domain == RADEON_GEM_DOMAIN_VRAM)
   241					domain_start = bo->rdev->mc.vram_start;
   242				else
   243					domain_start = bo->rdev->mc.gtt_start;
   244				WARN_ON_ONCE((*gpu_addr - domain_start) > max_offset);
                                              ^^^^^^^^^
New dereference.

   245			}
   246	

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-30 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-29 12:06 drm/radeon: Only warn if the intra-domain offset actually exceeds the limit Dan Carpenter
2012-03-29 14:47 ` [PATCH] drm/radeon: Don't dereference possibly-NULL pointer Michel Dänzer
2012-03-30 13:18   ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox