Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/mgag200: Remove unecessary NULL check in gem_free

The ->gem_free_object never gets called with a NULL pointer, the check
is redundant. Also checking after the upcast allows compilers to elide
it anyway.

Spotted by coverity.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

-2
-2
drivers/gpu/drm/mgag200/mgag200_main.c
··· 329 329 { 330 330 struct mgag200_bo *mgag200_bo = gem_to_mga_bo(obj); 331 331 332 - if (!mgag200_bo) 333 - return; 334 332 mgag200_bo_unref(&mgag200_bo); 335 333 } 336 334