Loading
usb: gadget: configfs: Ignore trailing LF for user strings to cdev
stable inclusion from stable-v6.6.72 commit ea57f0bbe225d189c1cb338a74c83fa559575e3b category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBQN9L Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ea57f0bbe225d189c1cb338a74c83fa559575e3b -------------------------------- commit 9466545720e231fc02acd69b5f4e9138e09a26f6 upstream. Since commit c0335632 ("usb: gadget: configfs: Attach arbitrary strings to cdev") a user can provide extra string descriptors to a USB gadget via configfs. For "manufacturer", "product", "serialnumber", setting the string via configfs ignores a trailing LF. For the arbitrary strings the LF was not ignored. This patch ignores a trailing LF to make this consistent with the existing behavior for "manufacturer", ... string descriptors. Fixes: c0335632 ("usb: gadget: configfs: Attach arbitrary strings to cdev") Cc: stable <stable@kernel.org> Signed-off-by:Ingo Rohloff <ingo.rohloff@lauterbach.com> Link: https://lore.kernel.org/r/20241212154114.29295-1-ingo.rohloff@lauterbach.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Wen Zhiwei <wenzhiwei@kylinos.cn>