usb: typec: tcpm: cancel frs hrtimer when unregister tcpm port
authorLi Jun <jun.li@nxp.com>
Wed, 2 Jun 2021 09:57:08 +0000 (17:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jun 2021 10:01:43 +0000 (12:01 +0200)
commit 7ade4805e296c8d1e40c842395bbe478c7210555 upstream.

Like the state_machine_timer, we should also cancel possible pending
frs hrtimer when unregister tcpm port.

Fixes: 8dc4bd073663 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1622627829-11070-2-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c

index 4395220a97dc0124c19b62fc2cfdd3f3b1598403..61929d37d7fc43c770d45a19f7636ab3eaa3cfd4 100644 (file)
@@ -5187,6 +5187,7 @@ void tcpm_unregister_port(struct tcpm_port *port)
 {
        int i;
 
+       hrtimer_cancel(&port->enable_frs_timer);
        hrtimer_cancel(&port->vdm_state_machine_timer);
        hrtimer_cancel(&port->state_machine_timer);