Skip to content

Commit ab5281d

Browse files
Dan Carpentergregkh
authored andcommitted
usb: typec: class: Unlocked on error in typec_register_partner()
commit 429a98a upstream. We recently added some locking to this function but this error path was accidentally missed. Unlock before returning. Fixes: ec27386 ("usb: typec: class: Fix NULL pointer access") Cc: stable <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ff42262 commit ab5281d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/typec/class.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ struct typec_partner *typec_register_partner(struct typec_port *port,
936936
ret = device_register(&partner->dev);
937937
if (ret) {
938938
dev_err(&port->dev, "failed to register partner (%d)\n", ret);
939+
mutex_unlock(&port->partner_link_lock);
939940
put_device(&partner->dev);
940941
return ERR_PTR(ret);
941942
}

0 commit comments

Comments
 (0)