diff options
| author | Linyu Yuan <quic_linyyuan@quicinc.com> | 2022-04-25 18:18:05 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-26 13:44:57 +0200 |
| commit | 87d0e2f41b8cc2018499be4e8003fa8c09b6f2fb (patch) | |
| tree | 8576bc6fbef62f38225c759bcb9665d58def63b7 /net/lapb/lapb_timer.c | |
| parent | 7a60fa06e80596dba5381fb018f5102ae4897658 (diff) | |
usb: typec: ucsi: add a common function ucsi_unregister_connectors()
In error path of ucsi_init(), it will unregister all valid ucsi connectors,
and similar operation also happen in ucsi_unregister(),
add a common function ucsi_unregister_connectors() for two places,
inside this function, if con->wq is NULL, it will break the loop,
if other kind of error happen after con->wq allocated,
ucsi/typec related API is safe to unregister.
Also in ucsi_init(), it allocate number of (ucsi->cap.num_connectors + 1)
connectors, there is one extra as the ending,
ucsi_unregister_connectors() is safe to unregister all ucsi connectors
according ucsi->cap.num_connectors,
remove the extra one connector to save memory.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/1650881886-25530-2-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions
