linux_dsm_epyc7002/drivers
Sudeep Holla a3592fa49d mailbox: arm_mhu_db: Fix mhu_db_shutdown by replacing kfree with devm_kfree
[ Upstream commit 9905f728b0bda737fe2c2afd7c24f3365a45cc7b ]

The mhu_db_channel info is allocated per channel using devm_kzalloc from
mhu_db_mbox_xlate which gets called from mbox_request_channel. However
we are releasing the allocated mhu_db_channel info using plain kfree from
mhu_db_shutdown which is called from mbox_free_channel.

This leads to random crashes when the channel is freed like below one:

  Unable to handle kernel paging request at virtual address 0080000400000008
  [0080000400000008] address between user and kernel address ranges
  Internal error: Oops: 96000044 [#1] PREEMPT SMP
  Modules linked in: scmi_module(-)
  CPU: 1 PID: 2212 Comm: rmmod Not tainted 5.10.0-rc5 #31
  Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno
  	Development Platform, BIOS EDK II Nov 19 2020
  pstate: 20000085 (nzCv daIf -PAN -UAO -TCO BTYPE=--)
  pc : release_nodes+0x74/0x230
  lr : devres_release_all+0x40/0x68
  Call trace:
   release_nodes+0x74/0x230
   devres_release_all+0x40/0x68
   device_release_driver_internal+0x12c/0x1f8
   driver_detach+0x58/0xe8
   bus_remove_driver+0x64/0xe0
   driver_unregister+0x38/0x68
   platform_driver_unregister+0x1c/0x28
   scmi_driver_exit+0x38/0x44 [scmi_module]
   __arm64_sys_delete_module+0x188/0x260
   el0_svc_common.constprop.0+0x80/0x1a8
   do_el0_svc+0x2c/0x98
   el0_sync_handler+0x160/0x168
   el0_sync+0x174/0x180
  Code: 1400000d eb07009f 54000460 f9400486 (f90004a6)
  ---[ end trace c55ffd306c140233 ]---

Fix it by replacing kfree with devm_kfree as required.

Fixes: 7002ca237b ("mailbox: arm_mhu: Add ARM MHU doorbell driver")
Reported-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-30 11:53:28 +01:00
..
accessibility speakup: Reject setting the speakup line discipline outside of speakup 2020-11-30 09:20:32 +01:00
acpi arm64 fixes for -rc6 2020-11-27 10:44:59 -08:00
amba
android
ata
atm
auxdisplay
base
bcma
block xen: add helpers for caching grant mapping pages 2020-12-09 10:31:37 +01:00
bluetooth Bluetooth: hci_h5: fix memory leak in h5_close 2020-12-30 11:53:05 +01:00
bus mips: cdmm: fix use-after-free in mips_cdmm_bus_discover 2020-12-30 11:53:24 +01:00
cdrom
char
clk clk: meson: Kconfig: fix dependency for G12A 2020-12-30 11:53:19 +01:00
clocksource
connector
counter
cpufreq
cpuidle
crypto crypto: sun8i-ce - fix two error path's memory leak 2020-12-30 11:53:17 +01:00
dax
dca
devfreq
dio
dma dmaengine: mv_xor_v2: Fix error return code in mv_xor_v2_probe() 2020-12-30 11:53:21 +01:00
dma-buf
edac EDAC/mce_amd: Use struct cpuinfo_x86.cpu_die_id for AMD NodeId 2020-12-30 11:53:16 +01:00
eisa
extcon
firewire
firmware firmware: arm_scmi: Fix missing destroy_workqueue() 2020-12-30 11:53:09 +01:00
fpga fpga: Specify HAS_IOMEM dependency for FPGA_DFL 2020-12-01 18:46:24 +01:00
fsi
gnss
gpio gpio: eic-sprd: break loop when getting NULL device resource 2020-12-09 09:41:49 +01:00
gpu drm/mediatek: Use correct aliases name for ovl 2020-12-30 11:53:24 +01:00
greybus
hid HID: i2c-hid: add Vero K147 to descriptor override 2020-12-26 16:02:43 +01:00
hsi HSI: omap_ssi: Don't jump to free ID in ssi_add_controller() 2020-12-30 11:53:24 +01:00
hv
hwmon hwmon: (k10temp) Remove support for displaying voltage and current on Zen CPUs 2020-12-30 11:52:55 +01:00
hwspinlock
hwtracing coresight: etm4x: Handle TRCVIPCSSCTLR accesses 2020-12-26 16:02:42 +01:00
i2c Revert "i2c: i2c-qcom-geni: Fix DMA transfer race" 2020-12-30 11:52:57 +01:00
i3c
ide
idle intel_idle: Build fix 2020-12-03 10:00:23 +01:00
iio iio: adc: at91_adc: add Kconfig dep on the OF symbol and remove of_match_ptr() 2020-12-30 11:52:55 +01:00
infiniband RDMA/hns: Bugfix for calculation of extended sge 2020-12-30 11:53:28 +01:00
input Input: omap4-keypad - fix runtime PM error handling 2020-12-30 11:53:19 +01:00
interconnect
iommu iommu/vt-d: include conditionally on CONFIG_INTEL_IOMMU_SVM 2020-12-30 11:53:14 +01:00
ipack
irqchip irqchip fixes for Linux 5.10, take #2 2020-11-25 00:56:28 +01:00
isdn
leds leds: turris-omnia: check for LED_COLOR_ID_RGB instead LED_COLOR_ID_MULTI 2020-12-30 11:53:22 +01:00
lightnvm
macintosh
mailbox mailbox: arm_mhu_db: Fix mhu_db_shutdown by replacing kfree with devm_kfree 2020-12-30 11:53:28 +01:00
mcb
md md: fix a warning caused by a race between concurrent md_ioctl()s 2020-12-26 16:02:45 +01:00
media media: max2175: fix max2175_set_csm_mode() error code 2020-12-30 11:53:24 +01:00
memory
memstick memstick: fix a double-free bug in memstick_check 2020-12-30 11:53:20 +01:00
message
mfd mfd: cpcap: Fix interrupt regression with regmap clear_ack 2020-12-30 11:53:16 +01:00
misc at24 fixes for v5.10 2020-12-11 23:23:30 +01:00
mmc mmc: pxamci: Fix error return code in pxamci_probe 2020-12-30 11:53:20 +01:00
most
mtd mtd: rawnand: xway: Do not force a particular software ECC engine 2020-12-11 20:10:02 +01:00
mux
net cw1200: fix missing destroy_workqueue() on error in cw1200_init_common 2020-12-30 11:53:21 +01:00
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
oprofile
parisc
parport
pci PCI: iproc: Invalidate correct PAXB inbound windows 2020-12-30 11:53:27 +01:00
pcmcia
perf
phy phy: tegra: xusb: Fix usb_phy device driver field 2020-12-30 11:53:26 +01:00
pinctrl pinctrl: sunxi: fix irq bank map for the Allwinner A100 pin controller 2020-12-30 11:53:20 +01:00
platform platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration 2020-12-30 11:53:23 +01:00
pnp
power power: supply: bq24190_charger: fix reference leak 2020-12-30 11:53:25 +01:00
powercap
pps
ps3
ptp ptp: clockmatrix: bug fix for idtcm_strverscmp 2020-11-25 17:24:49 -08:00
pwm pwm: sl28cpld: fix getting driver data in pwm callbacks 2020-12-03 09:57:37 -08:00
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc rtc: pcf2127: fix pcf2127_nvmem_read/write() returns 2020-12-30 11:52:57 +01:00
s390 Networking fixes for 5.10-rc6, including fixes from the WiFi driver, 2020-11-27 14:38:02 -08:00
sbus
scsi scsi: pm80xx: Do not sleep in atomic context 2020-12-30 11:53:27 +01:00
sfi
sh
siox
slimbus slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI 2020-12-30 11:53:24 +01:00
soc soc: amlogic: canvas: add missing put_device() call in meson_canvas_get() 2020-12-30 11:53:27 +01:00
soundwire soundwire: qcom: Fix build failure when slimbus is module 2020-12-30 11:53:22 +01:00
spi spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR 2020-12-30 11:53:27 +01:00
spmi
ssb
staging staging: mfd: hi6421-spmi-pmic: fix error return code in hi6421_spmi_pmic_probe() 2020-12-30 11:53:19 +01:00
target
tc
tee ARM: SoC fixes for v5.10, part 3 2020-11-27 14:48:03 -08:00
thermal
thunderbolt
tty serial: 8250-mtk: Fix reference leak in mtk8250_probe 2020-12-30 11:53:23 +01:00
uio
usb usb/max3421: fix return error code in max3421_probe() 2020-12-30 11:53:15 +01:00
vdpa vdpa: mlx5: fix vdpa/vhost dependencies 2020-12-02 04:09:56 -05:00
vfio
vhost vhost_vdpa: return -EFAULT if copy_to_user() fails 2020-12-02 04:36:40 -05:00
video video: fbdev: atmel_lcdfb: fix return error code in atmel_lcdfb_of_init() 2020-12-30 11:53:13 +01:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen: don't use page->lru for ZONE_DEVICE memory 2020-12-09 10:31:41 +01:00
zorro
Kconfig
Makefile vdpa: mlx5: fix vdpa/vhost dependencies 2020-12-02 04:09:56 -05:00