aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorAlbert Briscoe <albertsbriscoe@gmail.com>2022-09-11 15:37:55 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-22 15:52:29 +0200
commit24b7ba2f88e04800b54d462f376512e8c41b8a3c (patch)
treefa48ba5d85753139ae8d4713f61b0b7a289ed699 /drivers/usb/dwc3/gadget.c
parentxhci: remove unused lpm_failed_dev member from struct xhci_hcd (diff)
downloadlinux-dev-24b7ba2f88e04800b54d462f376512e8c41b8a3c.tar.xz
linux-dev-24b7ba2f88e04800b54d462f376512e8c41b8a3c.zip
usb: gadget: function: fix dangling pnp_string in f_printer.c
When opts->pnp_string is changed with configfs, new memory is allocated for the string. It does not, however, update dev->pnp_string, even though the memory is freed. When rquesting the string, the host then gets old or corrupted data rather than the new string. The ieee 1284 id string should be allowed to change while the device is connected. The bug was introduced in commit fdc01cc286be ("usb: gadget: printer: Remove pnp_string static buffer"), which changed opts->pnp_string from a char[] to a char*. This patch changes dev->pnp_string from a char* to a char** pointing to opts->pnp_string. Fixes: fdc01cc286be ("usb: gadget: printer: Remove pnp_string static buffer") Signed-off-by: Albert Briscoe <albertsbriscoe@gmail.com> Link: https://lore.kernel.org/r/20220911223753.20417-1-albertsbriscoe@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
0 files changed, 0 insertions, 0 deletions