Skip to content

Commit

Permalink
drm/vmwgfx: Remove unnecessary NULL checks before kvfree()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Thorsten Blum authored and Zack Rusin committed Oct 11, 2024
1 parent 26498b8 commit f07fd95
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/vmwgfx/vmwgfx_blit.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,8 @@ int vmw_bo_cpu_blit(struct vmw_bo *vmw_dst,
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;
}

0 comments on commit f07fd95

Please sign in to comment.