linux/drivers/usb
Xu Yang a826492fc9 usb: typec: tcpm: fix create duplicate source-capabilities file
The kernel will dump in the below cases:
sysfs: cannot create duplicate filename
'/devices/virtual/usb_power_delivery/pd1/source-capabilities'

1. After soft reset has completed, an Explicit Contract negotiation occurs.
The sink device will receive source capabilitys again. This will cause
a duplicate source-capabilities file be created.
2. Power swap twice on a device that is initailly sink role.

This will unregister existing capabilities when above cases occurs.

Fixes: 8203d26905 ("usb: typec: tcpm: Register USB Power Delivery Capabilities")
cc: <stable@vger.kernel.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230215054951.238394-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-09 15:15:05 +01:00
..
atm usb: move from strlcpy with unused retval to strscpy 2022-08-19 11:08:54 +02:00
c67x00
cdns3 Merge 6.2-rc5 into usb-next 2023-01-23 15:38:08 +01:00
chipidea USB: chipidea: fix memory leak with using debugfs_lookup() 2023-02-06 13:46:41 +01:00
class tty: Call ->dtr_rts() parameter active consistently 2023-01-19 16:04:35 +01:00
common Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
core Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
dwc2 usb: dwc2: power on/off phy for peripheral mode in dual-role mode 2022-12-08 16:50:56 +01:00
dwc3 usb: dwc3: gadget: Add 1ms delay after end transfer command without IOC 2023-03-09 14:54:46 +01:00
early usb: early: xhci-dbc: Use memcpy_and_pad() 2023-01-31 10:40:54 +01:00
fotg210 USB: fotg210: fix memory leak with using debugfs_lookup() 2023-02-06 13:46:42 +01:00
gadget usb: gadget: u_audio: don't let userspace block driver unbind 2023-03-09 14:56:32 +01:00
host phy-for-6.3 2023-02-24 17:22:11 -08:00
image usb/image: fix repeated words in comments 2022-07-27 14:33:53 +02:00
isp1760
misc usb: misc: onboard-hub: add support for Microchip USB2517 USB 2.0 hub 2023-03-09 14:54:46 +01:00
mon mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
mtu3 usb: mtu3: fix the failure of qmu stop 2023-01-19 14:12:08 +01:00
musb usb: musb: sunxi: Introduce config struct 2023-02-02 11:13:42 +01:00
phy Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-06-21 16:39:03 +02:00
roles driver core: make struct device_type.uevent() take a const * 2023-01-27 13:45:36 +01:00
serial TTY/Serial driver updates for 6.3-rc1 2023-02-24 12:17:14 -08:00
storage USB: ene_usb6250: Allocate enough memory for full object 2023-02-06 13:46:42 +01:00
typec usb: typec: tcpm: fix create duplicate source-capabilities file 2023-03-09 15:15:05 +01:00
usbip Including fixes from bpf, netfilter and can. 2022-12-21 08:41:32 -08:00
Kconfig usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
Makefile usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
usb-skeleton.c usb: add usb_set_intfdata() documentation 2022-11-29 08:56:09 +01:00