linux/drivers
Jens Wiklander 5854809b51 rpmb: fix error path in rpmb_dev_register()
Until this patch was rpmb_dev_register() always freeing rdev in the error
path. However, past device_register() it must not do that since the memory
is now managed by the device even if it failed to register properly. So fix
this by doing a put_device() before returning the error code.

Fixes the smatch warning:
        drivers/misc/rpmb-core.c:204 rpmb_dev_register()
        warn: freeing device managed memory (leak): 'rdev'

Fixes: 1e9046e3a1 ("rpmb: add Replay Protected Memory Block (RPMB) subsystem")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Link: https://lore.kernel.org/r/20240902105803.2885544-1-jens.wiklander@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2024-09-04 15:04:57 +02:00
..
accel
accessibility
acpi ACPI: video: Add backlight=native quirk for Dell OptiPlex 7760 AIO 2024-08-19 15:58:52 +02:00
amba
android
ata ata: pata_macio: Use WARN instead of BUG 2024-08-21 14:33:23 +09:00
atm
auxdisplay
base
bcma
block
bluetooth
bus
cache
cdrom
cdx
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma
dma-buf
dpll
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu UAPI Changes: 2024-08-23 09:12:16 +10:00
greybus
hid hid-for-linus-2024081901 2024-08-19 11:02:13 -07:00
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband
input Input updates for v6.11-rc4 2024-08-24 08:15:21 +08:00
interconnect
iommu iommufd 6.11 rc first pull 2024-08-20 16:06:39 -07:00
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc rpmb: fix error path in rpmb_dev_register() 2024-09-04 15:04:57 +02:00
mmc mmc: block: add RPMB dependency 2024-09-03 14:34:44 +02:00
most
mtd
mux
net net: xilinx: axienet: Fix dangling multicast addresses 2024-08-22 13:03:56 -07:00
nfc
ntb
nubus
nvdimm
nvme nvme: Remove unused field 2024-08-22 13:28:40 -07:00
nvmem
of
opp
parisc
parport
pci
pcmcia
peci
perf
phy
pinctrl
platform ACPI fix for 6.11-rc5 2024-08-24 07:39:35 +08:00
pmdomain
pnp
power power sequencing fixed for v6.11-rc5 2024-08-23 17:48:27 +08:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 s390 updates for 6.11-rc5 2024-08-25 12:05:23 +12:00
sbus
scsi SCSI fixes on 20240824 2024-08-25 12:00:16 +12:00
sh
siox
slimbus
soc
soundwire
spi spi: pxa2xx: Move PM runtime handling to the glue drivers 2024-08-22 13:34:06 +01:00
spmi
ssb
staging Kbuild fixes for v6.11 (2nd) 2024-08-23 07:43:15 +08:00
target
tc
tee optee: add RPMB dependency 2024-09-03 14:34:45 +02:00
thermal thermal: of: Fix OF node leak in of_thermal_zone_find() error paths 2024-08-22 20:58:49 +02:00
thunderbolt
tty
ufs
uio
usb
vdpa
vfio
vhost
video
virt
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile