Skip to contentSkip to conversation

patch "usb: typec: Add the missed altmode_id_remove() in" added to usb-testing

PATCH [email protected] 1 participant 1 message Jun 17, 2021

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: typec: Add the missed altmode_id_remove() in

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open.

If you have any questions about this process, please let me know.

From 03026197bb657d784220b040c6173267a0375741 Mon Sep 17 00:00:00 2001
From: Jing Xiangfeng <[email protected]>
Date: Thu, 17 Jun 2021 15:32:26 +0800
Subject: usb: typec: Add the missed altmode_id_remove() in
typec_register_altmode()

typec_register_altmode() misses to call altmode_id_remove() in an error path. Add the missed function call to fix it.

---
 drivers/usb/typec/class.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/typec/class.c +3 -1
index b9429c9f65f6..aeef453aa658 100644
@@ -517,8 +517,10 @@ typec_register_altmode(struct device *parent,
 	int ret;
 
 	alt = kzalloc(sizeof(*alt), GFP_KERNEL);
-	if (!alt)
+	if (!alt) {
+		altmode_id_remove(parent, id);
 		return ERR_PTR(-ENOMEM);
+	}
 
 	alt->adev.svid = desc->svid;
 	alt->adev.mode = desc->mode;
Signature · 1 line
2.32.0