linux-stable/drivers
Hans de Goede 9827caa510 phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered
[ Upstream commit bf6e4ee5c4 ]

The power_supply frame-work is not really designed for there to be
long living in kernel references to power_supply devices.

Specifically unregistering a power_supply while some other code has
a reference to it triggers a WARN in power_supply_unregister():

	WARN_ON(atomic_dec_return(&psy->use_cnt));

Folllowed by the power_supply still getting removed and the
backing data freed anyway, leaving the tusb1210 charger-detect code
with a dangling reference, resulting in a crash the next time
tusb1210_get_online() is called.

Fix this by only holding the reference in tusb1210_get_online()
freeing it at the end of the function. Note this still leaves
a theoretical race window, but it avoids the issue when manually
rmmod-ing the charger chip driver during development.

Fixes: 48969a5623 ("phy: ti: tusb1210: Add charger detection")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240406140821.18624-1-hdegoede@redhat.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-02 16:35:34 +02:00
..
accel accel/ivpu: Fix deadlock in context_xa 2024-04-17 11:23:37 +02:00
accessibility speakup: Avoid crash on very long word 2024-04-27 17:13:01 +02:00
acpi ACPI: CPPC: Fix access width used for PCC registers 2024-05-02 16:35:30 +02:00
amba
android binder: check offset alignment in binder_get_object() 2024-04-27 17:12:58 +02:00
ata ata: libata-scsi: Fix ata_scsi_dev_rescan() error path 2024-04-17 11:23:23 +02:00
atm
auxdisplay
base base/node / ACPI: Enumerate node access class for 'struct access_coordinate' 2024-04-17 11:23:29 +02:00
bcma
block
bluetooth Bluetooth: qca: fix NULL-deref on non-serdev setup 2024-05-02 16:35:26 +02:00
bus bus: mhi: host: Add MHI_PM_SYS_ERR_FAIL state 2024-04-13 13:10:08 +02:00
cache
cdrom
cdx
char random: handle creditable entropy from atomic process context 2024-04-27 17:12:48 +02:00
clk clk: mediatek: mt7988-infracfg: fix clocks for 2nd PCIe port 2024-04-27 17:12:56 +02:00
clocksource clocksource/drivers/arm_global_timer: Fix maximum prescaler value 2024-04-03 15:32:32 +02:00
comedi comedi: vmk80xx: fix incomplete endpoint checking 2024-04-27 17:12:58 +02:00
connector
counter
cpufreq cpufreq: Don't unregister cpufreq cooling on CPU hotplug 2024-04-13 13:10:01 +02:00
cpuidle cpuidle: Avoid potential overflow in integer multiplication 2024-04-13 13:09:58 +02:00
crypto crypto: iaa - Fix async_disable descriptor leak 2024-04-13 13:10:07 +02:00
cxl cxl/core: Fix potential payload size confusion in cxl_mem_get_poison() 2024-05-02 16:35:16 +02:00
dax
dca
devfreq
dio
dma dmaengine: idxd: Fix oops during rmmod on single-CPU platforms 2024-05-02 16:35:33 +02:00
dma-buf dma-buf: Fix NULL pointer dereference in sanitycheck() 2024-04-10 16:37:54 +02:00
dpll dpll: fix dpll_pin_on_pin_register() for multiple parent pins 2024-05-02 16:35:22 +02:00
edac
eisa
extcon
firewire
firmware firmware: qcom: uefisecapp: Fix memory related IO errors and crashes 2024-05-02 16:35:31 +02:00
fpga
fsi
gnss
gpio gpio: tegra186: Fix tegra186_gpio_is_accessible() check 2024-05-02 16:35:17 +02:00
gpu drm/amdkfd: Fix eviction fence handling 2024-05-02 16:35:29 +02:00
greybus
hid HID: i2c-hid: Revert to await reset ACK before reading report descriptor 2024-05-02 16:35:27 +02:00
hsi
hte
hv x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:17:30 -04:00
hwmon hwmon: (amc6821) add of_match table 2024-04-03 15:32:16 +02:00
hwspinlock
hwtracing hwtracing: hisi_ptt: Move type check to the beginning of hisi_ptt_pmu_event_init() 2024-03-26 18:17:30 -04:00
i2c i2c: designware: Fix RX FIFO depth define on Wangxun 10Gb NIC 2024-04-13 13:10:06 +02:00
i3c i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling 2024-03-26 18:17:24 -04:00
idle
iio iio: adc: rockchip_saradc: use mask for write_enable bitfield 2024-04-03 15:32:08 +02:00
infiniband RDMA/mlx5: Fix port number for counter query in multi-port configuration 2024-04-27 17:12:53 +02:00
input Input: xpad - add support for Snakebyte GAMEPADs 2024-04-13 13:10:08 +02:00
interconnect interconnect: Don't access req_list while it's being manipulated 2024-04-27 17:12:56 +02:00
iommu iommufd: Add missing IOMMUFD_DRIVER kconfig for the selftest 2024-04-27 17:12:54 +02:00
ipack
irqchip irqchip/gic-v3-its: Prevent double free on error 2024-05-02 16:35:30 +02:00
isdn
leds leds: trigger: netdev: Fix kernel panic on interface rename trig notify 2024-04-03 15:32:15 +02:00
macintosh
mailbox
mcb
md raid1: fix use-after-free for original bio in raid1_write_request() 2024-04-17 11:23:24 +02:00
media media: cec: core: remove length check of Timer Status 2024-04-17 11:23:25 +02:00
memory memory: tegra: Correct DLA client names 2024-03-26 18:16:46 -04:00
memstick
message
mfd mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 2024-04-03 15:32:35 +02:00
misc eeprom: at24: fix memory corruption race condition 2024-05-02 16:35:28 +02:00
mmc mmc: sdhci-of-dwcmshc: th1520: Increase tuning loop count to 128 2024-05-02 16:35:26 +02:00
most
mtd mtd: diskonchip: work around ubsan link failure 2024-05-02 16:35:31 +02:00
mux
net macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst 2024-05-02 16:35:31 +02:00
nfc NFC: trf7970a: disable all regulators on removal 2024-05-02 16:35:16 +02:00
ntb NTB: fix possible name leak in ntb_register_device() 2024-03-26 18:17:06 -04:00
nubus
nvdimm
nvme drivers/nvme: Add quirks for device 126f:2262 2024-04-13 13:10:10 +02:00
nvmem nvmem: meson-efuse: fix function pointer type mismatch 2024-04-03 15:32:16 +02:00
of of: module: prevent NULL pointer dereference in vsnprintf() 2024-04-10 16:38:19 +02:00
opp OPP: debugfs: Fix warning around icc_get_name() 2024-03-26 18:16:56 -04:00
parisc
parport
pci PCI: hv: Fix ring buffer size calculation 2024-04-03 15:32:18 +02:00
pcmcia
peci
perf drivers/perf: hisi: Enable HiSilicon Erratum 162700402 quirk for HIP09 2024-04-13 13:10:07 +02:00
phy phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered 2024-05-02 16:35:34 +02:00
pinctrl pinctrl: renesas: checker: Limit cfg reg enum checks to provided IDs 2024-04-13 13:10:03 +02:00
platform platform/x86/amd/pmc: Extend Framework 13 quirk to more BIOSes 2024-04-27 17:12:55 +02:00
pmdomain pmdomain: imx8mp-blk-ctrl: imx8mp_blk: Add fdcc clock to hdmimix domain 2024-04-13 13:09:59 +02:00
pnp
power power: supply: mm8013: fix "not charging" detection 2024-03-26 18:17:17 -04:00
powercap powercap: intel_rapl_tpmi: Fix System Domain probing 2024-04-03 15:32:04 +02:00
pps
ps3
ptp
pwm pwm: img: fix pwm clock lookup 2024-04-03 15:32:35 +02:00
rapidio
ras
regulator regulator: userspace-consumer: add module device table 2024-03-26 18:16:50 -04:00
remoteproc remoteproc: virtio: Fix wdg cannot recovery remote processor 2024-04-03 15:32:01 +02:00
reset
rpmsg
rtc rtc: max31335: fix interrupt status reg 2024-03-26 18:17:30 -04:00
s390 s390/cio: fix race condition during online processing 2024-04-27 17:12:54 +02:00
sbus
scsi scsi: core: Fix handling of SCMD_FAIL_IF_RECOVERING 2024-04-27 17:12:48 +02:00
sh
siox
slimbus slimbus: core: Remove usage of the deprecated ida_simple_xx() API 2024-04-03 15:32:16 +02:00
soc soc: mediatek: mtk-svs: Append "-thermal" to thermal zone names 2024-05-02 16:35:16 +02:00
soundwire soundwire: amd: fix for wake interrupt handling for clockstop mode 2024-05-02 16:35:32 +02:00
spi spi: mchp-pci1xxx: Fix a possible null pointer dereference in pci1xxx_spi_probe 2024-04-10 16:38:13 +02:00
spmi
ssb
staging staging: vc04_services: fix information leak in create_component() 2024-04-03 15:32:45 +02:00
target
tc
tee
thermal thermal/debugfs: Add missing count increment to thermal_debug_tz_trip_up() 2024-04-27 17:12:55 +02:00
thunderbolt thunderbolt: Reset only non-USB4 host routers in resume 2024-04-27 17:13:04 +02:00
tty serial: core: Fix missing shutdown and startup for serial base port 2024-04-27 17:12:59 +02:00
ufs scsi: ufs: qcom: Add missing interconnect bandwidth values for Gear 5 2024-04-27 17:12:49 +02:00
uio
usb usb: xhci: correct return value in case of STS_HCE 2024-05-02 16:35:23 +02:00
vdpa vdpa/mlx5: Allow CVQ size changes 2024-03-26 18:17:35 -04:00
vfio vfio/pds: Make sure migration file isn't accessed after reset 2024-04-03 15:32:44 +02:00
vhost vhost: Add smp_rmb() in vhost_enable_notify() 2024-04-17 11:23:39 +02:00
video fbdev: fix incorrect address computation in deferred IO 2024-05-02 16:35:31 +02:00
virt Revert "vmgenid: emit uevent when VMGENID updates" 2024-04-27 17:12:48 +02:00
virtio virtio: reenable config if freezing device failed 2024-04-03 15:32:25 +02:00
w1
watchdog watchdog: stm32_iwdg: initialize default timeout 2024-03-26 18:17:25 -04:00
xen x86/xen: attempt to inflate the memory balloon on PVH 2024-04-13 13:10:10 +02:00
zorro
Kconfig
Makefile