android_kernel_motorola_sm6375/drivers
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yang Yingliang b9d179c605 UPSTREAM: driver core: Fix possible memory leak in device_link_add()
I got memory leak as follows:

unreferenced object 0xffff88801f0b2200 (size 64):
  comm "i2c-lis2hh12-21", pid 5455, jiffies 4294944606 (age 15.224s)
  hex dump (first 32 bytes):
    72 65 67 75 6c 61 74 6f 72 3a 72 65 67 75 6c 61  regulator:regula
    74 6f 72 2e 30 2d 2d 69 32 63 3a 31 2d 30 30 31  tor.0--i2c:1-001
  backtrace:
    [<00000000bf5b0c3b>] __kmalloc_track_caller+0x19f/0x3a0
    [<0000000050da42d9>] kvasprintf+0xb5/0x150
    [<000000004bbbed13>] kvasprintf_const+0x60/0x190
    [<00000000cdac7480>] kobject_set_name_vargs+0x56/0x150
    [<00000000bf83f8e8>] dev_set_name+0xc0/0x100
    [<00000000cc1cf7e3>] device_link_add+0x6b4/0x17c0
    [<000000009db9faed>] _regulator_get+0x297/0x680
    [<00000000845e7f2b>] _devm_regulator_get+0x5b/0xe0
    [<000000003958ee25>] st_sensors_power_enable+0x71/0x1b0 [st_sensors]
    [<000000005f450f52>] st_accel_i2c_probe+0xd9/0x150 [st_accel_i2c]
    [<00000000b5f2ab33>] i2c_device_probe+0x4d8/0xbe0
    [<0000000070fb977b>] really_probe+0x299/0xc30
    [<0000000088e226ce>] __driver_probe_device+0x357/0x500
    [<00000000c21dda32>] driver_probe_device+0x4e/0x140
    [<000000004e650441>] __device_attach_driver+0x257/0x340
    [<00000000cf1891b8>] bus_for_each_drv+0x166/0x1e0

When device_register() returns an error, the name allocated in dev_set_name()
will be leaked, the put_device() should be used instead of kfree() to give up
the device reference, then the name will be freed in kobject_cleanup() and the
references of consumer and supplier will be decreased in device_link_release_fn().

Fixes: 287905e68dd2 ("driver core: Expose device link details in sysfs")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210930085714.2057460-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit df0a18149474c7e6b21f6367fbc6bc8d0f192444)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iba22f7d2f05da2cd24abe157d36fcb4c05b8ee82
2022-01-24 11:41:01 -08:00
..
accessibility
acpi This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
amba This is the 5.4.158 stable release 2021-11-06 14:08:38 +01:00
android UPSTREAM: binder: fix the missing BR_FROZEN_REPLY in binder_return_strings 2022-01-24 11:41:01 -08:00
ata libata: fix checking of DMA state 2021-11-17 09:48:23 +01:00
atm atm: nicstar: register the interrupt handler in the right place 2021-07-19 08:53:12 +02:00
auxdisplay auxdisplay: ht16k33: Fix frame buffer device blanking 2021-11-17 09:48:45 +01:00
base UPSTREAM: driver core: Fix possible memory leak in device_link_add() 2022-01-24 11:41:01 -08:00
bcma bcma: Fix memory leak for internally-handled cores 2021-09-15 09:47:37 +02:00
block This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
bluetooth This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
bus bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893 2021-10-13 10:08:19 +02:00
cdrom cdrom: gdrom: initialize global variable at init time 2021-05-26 12:05:19 +02:00
char This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
clk This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
clocksource This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
connector
counter counter: 104-quad-8: Return error when invalid mode during ceiling_write 2021-09-15 09:47:34 +02:00
cpufreq This is the 5.4.151 stable release 2021-10-06 15:51:50 +02:00
cpuidle This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
crypto This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
dax
dca
devfreq
dio
dma This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
dma-buf This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
edac EDAC/amd64: Handle three rank interleaving mode 2021-11-17 09:48:36 +01:00
eisa
extcon Merge 5.4.133 into android11-5.4-lts 2021-07-20 11:32:58 +02:00
firewire
firmware This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
fpga fpga: machxo2-spi: Fix missing error code in machxo2_write_complete() 2021-09-30 10:09:23 +02:00
fsi fsi/sbefifo: Fix reset timeout 2021-07-14 16:53:42 +02:00
gnss
gpio gpio: pca953x: Improve bias setting 2021-10-20 11:40:15 +02:00
gpu This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
greybus
hid Merge tag 'android11-5.4.161_r00' into android11-5.4 2022-01-21 08:26:49 +01:00
hsi
hv hyperv/vmbus: include linux/bitops.h 2021-11-17 09:48:20 +01:00
hwmon This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
hwspinlock
hwtracing intel_th: Wait until port is in reset before programming it 2021-07-20 16:10:46 +02:00
i2c This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
i3c
ide
idle
iio iio: dac: ad5446: Fix ad5622_write() return value 2021-11-17 09:48:26 +01:00
infiniband This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
input Input: i8042 - Add quirk for Fujitsu Lifebook T725 2021-11-17 09:48:17 +01:00
interconnect
iommu Linux 5.4.143 2021-08-27 22:38:57 +02:00
ipack ipack: ipoctal: fix module reference leak 2021-10-06 15:42:36 +02:00
irqchip This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
isdn isdn: mISDN: Fix sleeping function called from invalid context 2021-10-27 09:54:29 +02:00
leds leds: trigger: audio: Add an activate callback to ensure the initial brightness is set 2021-09-15 09:47:33 +02:00
lightnvm
macintosh
mailbox
mcb mcb: fix error handling in mcb_alloc_bus() 2021-09-30 10:09:22 +02:00
md This is the 5.4.150 stable release 2021-10-01 14:08:40 +02:00
media This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
memory memory: fsl_ifc: fix leak of irq and nand_irq in fsl_ifc_ctrl_probe 2021-11-17 09:48:42 +01:00
memstick memstick: jmb38x_ms: use appropriate free function in jmb38x_ms_alloc_host() 2021-11-17 09:48:37 +01:00
message
mfd This is the 5.4.148 stable release 2021-09-25 14:41:58 +02:00
misc This is the 5.4.155 stable release 2021-10-20 12:35:49 +02:00
mmc This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
mtd This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
mux
net This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
nfc nfc: pn533: Fix double free when pn533_fill_fragment_skbs() fails 2021-11-17 09:48:47 +01:00
ntb NTB: perf: Fix an error code in perf_setup_inbuf() 2021-09-22 12:26:44 +02:00
nubus
nvdimm libnvdimm/pmem: Fix crash triggered when I/O in-flight during unbind 2021-10-06 15:42:38 +02:00
nvme nvme-rdma: fix error code in nvme_rdma_setup_ctrl 2021-11-17 09:48:38 +01:00
nvmem This is the 5.4.155 stable release 2021-10-20 12:35:49 +02:00
of Merge branch 'android11-5.4' into 'android11-5.4-lts' 2021-10-14 09:25:51 +02:00
opp This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
oprofile
parisc parisc: Move pci_dev_is_behind_card_dino to where it is used 2021-09-26 14:07:10 +02:00
parport parport: remove non-zero check on count 2021-09-22 12:26:36 +02:00
pci This is the 5.4.161 stable release 2021-11-21 15:34:05 +01:00
pcmcia pcmcia: i82092: fix a null pointer dereference bug 2021-08-12 13:21:03 +02:00
perf drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe() 2021-07-14 16:53:14 +02:00
phy This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
pinctrl This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
platform This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
pnp
power This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
powercap
pps
ps3
ptp ptp_pch: Load module automatically if ID matches 2021-10-13 10:08:19 +02:00
pwm Merge 5.4.149 into android11-5.4-lts 2021-10-01 14:07:54 +02:00
rapidio rapidio: handle create_workqueue() failure 2021-05-26 12:05:17 +02:00
ras
regulator This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
remoteproc
reset This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
rpmsg This is the 5.4.120 stable release 2021-05-19 10:41:47 +02:00
rtc Merge 5.4.149 into android11-5.4-lts 2021-10-01 14:07:54 +02:00
s390 s390/cio: make ccw_device_dma_* more robust 2021-11-17 09:48:50 +01:00
sbus
scsi This is the 5.4.161 stable release 2021-11-21 15:34:05 +01:00
sfi
sh
siox
slimbus Linux 5.4.143 2021-08-27 22:38:57 +02:00
soc This is the 5.4.161 stable release 2021-11-21 15:34:05 +01:00
soundwire soundwire: stream: Fix test for DP prepare complete 2021-07-14 16:53:45 +02:00
spi This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
spmi
ssb ssb: Fix error return code in ssb_bus_scan() 2021-07-14 16:53:29 +02:00
staging This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
target scsi: target: avoid per-loop XCOPY buffer allocations 2021-09-22 12:26:25 +02:00
tc
tee tee: optee: Fix missing devices unregister during optee_remove 2021-10-27 09:54:25 +02:00
thermal Merge tag 'android11-5.4.147_r00' android11-5.4 2021-10-20 10:32:16 +02:00
thunderbolt thunderbolt: dma_port: Fix NVM read buffer bounds and offset issue 2021-06-03 08:59:03 +02:00
tty Revert "serial: core: Fix initializing and restoring termios speed" 2021-11-19 13:42:39 +01:00
uio uio_hv_generic: Fix a memory leak in error handling paths 2021-05-26 12:05:17 +02:00
usb Merge tag 'android11-5.4.161_r00' into android11-5.4 2022-01-21 08:26:49 +01:00
vfio This is the 5.4.148 stable release 2021-09-25 14:41:58 +02:00
vhost This is the 5.4.148 stable release 2021-09-25 14:41:58 +02:00
video This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
virt
virtio This is the 5.4.155 stable release 2021-10-20 12:35:49 +02:00
visorbus visorbus: fix error return code in visorchipset_init() 2021-07-14 16:53:42 +02:00
vlynq
vme
w1 w1: ds2438: fixing bug that would always get page0 2021-07-20 16:10:41 +02:00
watchdog ar7: fix kernel builds for compiler test 2021-11-17 09:48:46 +01:00
xen xen-pciback: Fix return in pm_ctrl_init() 2021-11-17 09:48:46 +01:00
zorro
Kconfig
Makefile
OWNERS