drm/amd/display: fix ifnullfree.cocci warnings
authorkbuild test robot <fengguang.wu@intel.com>
Thu, 12 Oct 2017 23:17:48 +0000 (07:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 21 Oct 2017 20:50:37 +0000 (16:50 -0400)
commit2979d7e973464c00154fa4fe029de128de3e51db
treea2ba18e11c2bb17f83443f88ab9ba8999e6d8038
parent1a7e4f7407e8869759be7e715bce18698aadbe98
drm/amd/display: fix ifnullfree.cocci warnings

drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/gpio_service.c:134:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/gpio_service.c:175:4-9: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes: f09cd1f46388 ("drm/amd/display: Use kernel alloc/free")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c