kfree on NULL pointer is a no-op.
Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/* unmap all devices */
for (i = 0; i < device_num; i++) {
#ifdef BP_SELF_TEST
- if (bpctl_dev_arr[i].bp_tx_data)
- kfree(bpctl_dev_arr[i].bp_tx_data);
+ kfree(bpctl_dev_arr[i].bp_tx_data);
#endif
iounmap((void *)(bpctl_dev_arr[i].mem_map));
}
/* free all devices space */
- if (bpctl_dev_arr)
- kfree(bpctl_dev_arr);
+ kfree(bpctl_dev_arr);
/*
* Unregister the device