Merge tag 'usb-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[platform/kernel/linux-starfive.git] / drivers / platform / chrome / cros_ec_typec.c
index d5bc402..001b0de 100644 (file)
@@ -173,10 +173,13 @@ static int cros_typec_get_switch_handles(struct cros_typec_port *port,
 
 role_sw_err:
        typec_switch_put(port->ori_sw);
+       port->ori_sw = NULL;
 ori_sw_err:
        typec_retimer_put(port->retimer);
+       port->retimer = NULL;
 retimer_sw_err:
        typec_mux_put(port->mux);
+       port->mux = NULL;
 mux_err:
        return -ENODEV;
 }