]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/vmwgfx: Remove unnecessary NULL checks before kvfree()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 7 Oct 2024 11:51:32 +0000 (13:51 +0200)
committerZack Rusin <zack.rusin@broadcom.com>
Fri, 11 Oct 2024 03:01:45 +0000 (23:01 -0400)
Since kvfree() already checks if its argument is NULL, an additional
check before calling kvfree() is unnecessary and can be removed.

Remove both and the following Coccinelle/coccicheck warnings reported by
ifnullfree.cocci:

  WARNING: NULL check before some freeing functions is not needed
  WARNING: NULL check before some freeing functions is not needed

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241007115131.1811-3-thorsten.blum@linux.dev
drivers/gpu/drm/vmwgfx/vmwgfx_blit.c

index 890a66a2361f4e19826a27096e0a88ffd01447cb..64bd7d74854e1a079cf282c9e063ca5f02110fcc 100644 (file)
@@ -635,10 +635,8 @@ out:
                kunmap_atomic(d.src_addr);
        if (d.dst_addr)
                kunmap_atomic(d.dst_addr);
-       if (src_pages)
-               kvfree(src_pages);
-       if (dst_pages)
-               kvfree(dst_pages);
+       kvfree(src_pages);
+       kvfree(dst_pages);
 
        return ret;
 }