Skip to content

Commit f07fd95

Browse files
tobluxzackr
authored andcommitted
drm/vmwgfx: Remove unnecessary NULL checks before kvfree()
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 <[email protected]> Signed-off-by: Zack Rusin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 26498b8 commit f07fd95

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_blit.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,10 +635,8 @@ int vmw_bo_cpu_blit(struct vmw_bo *vmw_dst,
635635
kunmap_atomic(d.src_addr);
636636
if (d.dst_addr)
637637
kunmap_atomic(d.dst_addr);
638-
if (src_pages)
639-
kvfree(src_pages);
640-
if (dst_pages)
641-
kvfree(dst_pages);
638+
kvfree(src_pages);
639+
kvfree(dst_pages);
642640

643641
return ret;
644642
}

0 commit comments

Comments
 (0)