Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 311fa89d authored by Jack Pham's avatar Jack Pham Committed by Matt Wagantall
Browse files

usb: composite: Reuse existing strings in usb_gstrings_attach



A function driver may call usb_gstrings_attach() when being
bound to a composite configuration in order to reserve string
IDs for its strings. However, if the function is unbound and
rebound to the same composite device (in cases of dynamic
composition switching), repeated calls to usb_gstrings_attach()
may exhaust the 255 available string IDs. In this case first
check if the cdev already contains the same strings being added,
and if so just reuse them and their previously allocated IDs.

Change-Id: I975a6a2989cb296d4f9c732389ee6241c7e087c4
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent bee2e1b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment