Skip to content

Commit

Permalink
staging: silicom: Remove redundant NULL check before kfree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Syam Sidhardhan authored and Greg Kroah-Hartman committed Mar 11, 2013
1 parent f54ab7d commit d39625c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/silicom/bp_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -6995,15 +6995,13 @@ static void __exit bypass_cleanup_module(void)
/* 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
Expand Down

0 comments on commit d39625c

Please sign in to comment.