drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 22 Jul 2016 12:14:54 +0000 (14:14 +0200)
committerSean Paul <seanpaul@chromium.org>
Fri, 22 Jul 2016 15:23:39 +0000 (11:23 -0400)
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns immediately.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/913198fa-2aa4-4804-8616-dd495428c0a5@users.sourceforge.net
drivers/gpu/drm/qxl/qxl_display.c

index ad429683fef771f2f05da51518b9f0383279d7c2..3aef12742a53b895fac7be63651643d5db9325e2 100644 (file)
@@ -468,8 +468,7 @@ void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
 {
        struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);
 
-       if (qxl_fb->obj)
-               drm_gem_object_unreference_unlocked(qxl_fb->obj);
+       drm_gem_object_unreference_unlocked(qxl_fb->obj);
        drm_framebuffer_cleanup(fb);
        kfree(qxl_fb);
 }