mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 06:16:46 +07:00
thunderbolt: Allow passing NULL to tb_ctl_free()
Following the usual pattern used in many places, we allow passing NULL pointer to tb_ctl_free(). Then the user can call the function regardless if it has allocated control channel or not making the code bit simpler. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andreas Noever <andreas.noever@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
da2da04b8d
commit
c9843ebbb8
@ -520,6 +520,10 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, hotplug_cb cb, void *cb_data)
|
||||
void tb_ctl_free(struct tb_ctl *ctl)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!ctl)
|
||||
return;
|
||||
|
||||
if (ctl->rx)
|
||||
ring_free(ctl->rx);
|
||||
if (ctl->tx)
|
||||
|
Loading…
Reference in New Issue
Block a user