linux-stable/drivers
Jeremy Kerr 67a358b01e fsi/core: Fix error paths on CFAM init
[ Upstream commit 371975b0b0 ]

Change d1dcd67825 re-worked the struct fsi_slave initialisation in
fsi_slave_init, but introduced a few inconsitencies: the slave->dev is
now registered through cdev_device_add, but we may kfree() the device
out from underneath the cdev registration. We may also leave an IDA
allocated.

This change fixes the error paths, so that we kfree() only before the
device is registered with the core code. We also move the smode write to
before we start creating proper devices, as it's the most likely to
fail. We also remove the IDA-allocated minor on error, and properly
clean up the of_node.

Fixes: d1dcd67825 ("fsi: Add cfam char devices")
Reported-by: Lei YU <mine260309@gmail.com>
Tested-by: John Wang <wangzqbj@inspur.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:51:00 +01:00
..
accessibility
acpi ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS 2020-01-27 14:51:00 +01:00
amba
android binder: Handle start==NULL in binder_update_page_range() 2019-12-13 08:52:52 +01:00
ata libata: Fix retrieving of active qcs 2020-01-09 10:19:01 +01:00
atm atm: zatm: Fix empty body Clang warnings 2019-12-01 09:16:41 +01:00
auxdisplay
base driver core: Fix PM-runtime for links added during consumer probe 2020-01-27 14:50:26 +01:00
bcma
block rbd: clear ->xferred on error from rbd_obj_issue_copyup() 2020-01-27 14:50:30 +01:00
bluetooth Bluetooth: btusb: fix PM leak in error case of setup 2020-01-09 10:19:04 +01:00
bus bus: ti-sysc: Fix sysc_unprepare() when no clocks have been allocated 2020-01-27 14:50:36 +01:00
cdrom cdrom: respect device capabilities during opening action 2020-01-04 19:13:12 +01:00
char hwrng: bcm2835 - fix probe as platform device 2020-01-27 14:50:29 +01:00
clk clk: qcom: Fix -Wunused-const-variable 2020-01-27 14:50:58 +01:00
clocksource clocksource/drivers/exynos_mct: Fix error path in timer resources initialization 2020-01-27 14:50:27 +01:00
connector
cpufreq cpufreq: brcmstb-avs-cpufreq: Fix types for voltage/frequency 2020-01-27 14:50:53 +01:00
cpuidle cpuidle: Do not unset the driver if it is there already 2019-12-17 20:35:00 +01:00
crypto crypto: inside-secure - fix queued len computation 2020-01-27 14:50:53 +01:00
dax
dca
devfreq PM / devfreq: Check NULL governor in available_governors_show 2020-01-09 10:19:03 +01:00
dio
dma dmaengine: hsu: Revert "set HSU_CH_MTSR to memory width" 2020-01-27 14:50:57 +01:00
dma-buf dma-buf: Fix memory leak in sync_file_merge() 2019-12-21 10:57:38 +01:00
edac EDAC/mc: Fix edac_mc_find() in case no device is found 2020-01-27 14:50:48 +01:00
eisa
extcon extcon: sm5502: Reset registers during initialization 2019-12-31 16:35:11 +01:00
firewire net: add annotations on hh->hh_len lockless accesses 2020-01-09 10:19:09 +01:00
firmware firmware: arm_scmi: update rate_discrete in clock_describe_rates_get 2020-01-27 14:50:54 +01:00
fmc
fpga
fsi fsi/core: Fix error paths on CFAM init 2020-01-27 14:51:00 +01:00
gnss
gpio gpio: mpc8xxx: Add platform device to gpiochip->parent 2020-01-17 19:47:14 +01:00
gpu drm/msm/a3xx: remove TPL1 regs from snapshot 2020-01-27 14:50:57 +01:00
hid HID: hidraw, uhid: Always report EPOLLOUT 2020-01-17 19:46:55 +01:00
hsi
hv
hwmon hwmon: (w83627hf) Use request_muxed_region for Super-IO accesses 2020-01-27 14:50:39 +01:00
hwspinlock
hwtracing coresight: catu: fix clang build warning 2020-01-27 14:50:42 +01:00
i2c i2c: i2c-stm32f7: fix 10-bits check in slave free id search loop 2020-01-27 14:49:51 +01:00
ide
idle
iio iio: buffer: align the size of scan bytes to size of the largest element 2020-01-23 08:21:27 +01:00
infiniband IB/hfi1: Handle port down properly in pio 2020-01-27 14:50:56 +01:00
input Input: nomadik-ske-keypad - fix a loop timeout test 2020-01-27 14:50:07 +01:00
iommu iommu/amd: Make iommu_disable safer 2020-01-27 14:50:59 +01:00
ipack
irqchip irqchip: Place CONFIG_SIFIVE_PLIC into the menu 2020-01-23 08:21:36 +01:00
isdn staging: gigaset: add endpoint-type sanity check 2019-12-17 20:34:33 +01:00
leds leds: lm3692x: Handle failure to probe the regulator 2020-01-04 19:12:43 +01:00
lightnvm lightnvm: pblk: fix lock order in pblk_rb_tear_down_check 2020-01-27 14:50:45 +01:00
macintosh macintosh/windfarm_smu_sat: Fix debug output 2019-12-01 09:16:37 +01:00
mailbox mailbox: ti-msgmgr: Off by one in ti_msgmgr_of_xlate() 2020-01-27 14:50:04 +01:00
mcb
md block: fix an integer overflow in logical block size 2020-01-23 08:21:29 +01:00
media media: vivid: fix incorrect assignment operation when setting video mode 2020-01-27 14:50:53 +01:00
memory memory: tegra: Don't invoke Tegra30+ specific memory timing setup on Tegra20 2020-01-27 14:50:13 +01:00
memstick
message scsi: mptfusion: Fix double fetch bug in ioctl 2020-01-23 08:21:28 +01:00
mfd mfd: intel-lpss: Release IDA resources 2020-01-27 14:50:59 +01:00
misc misc: sgi-xp: Properly initialize buf in xpc_get_rsvd_page_pa 2020-01-27 14:50:51 +01:00
mmc mmc: core: fix possible use after free of host 2020-01-27 14:50:45 +01:00
mtd mtd: devices: fix mchp23k256 read and write 2020-01-23 08:21:37 +01:00
mux
net bnxt_en: Suppress error messages when querying DSCP DCB capabilities. 2020-01-27 14:50:58 +01:00
nfc NFC: pn533: fix bulk-message timeout 2020-01-23 08:21:34 +01:00
ntb ntb_hw_switchtec: potential shift wrapping bug in switchtec_ntb_init_sndev() 2020-01-27 14:50:55 +01:00
nubus
nvdimm libnvdimm/btt: fix variable 'rc' set but not used 2020-01-04 19:13:00 +01:00
nvme nvme-fc: fix double-free scenarios on hw queues 2020-01-09 10:18:54 +01:00
nvmem nvmem: imx-ocotp: Change TIMING calculation to u-boot algorithm 2020-01-27 14:50:58 +01:00
of of: unittest: fix memory leak in attach_node_and_children 2019-12-17 20:36:04 +01:00
opp OPP: Fix missing debugfs supply directory for OPPs 2020-01-27 14:50:04 +01:00
oprofile
parisc
parport parport: load lowlevel driver if ports not found 2019-12-31 16:36:01 +01:00
pci PM: ACPI/PCI: Resume all devices during hibernation 2020-01-27 14:50:59 +01:00
pcmcia
perf
phy phy: usb: phy-brcm-usb: Remove sysfs attributes upon driver removal 2020-01-27 14:50:54 +01:00
pinctrl pinctrl: sh-pfc: sh73a0: Fix fsic_spdif pin groups 2020-01-27 14:50:22 +01:00
platform platform/x86: alienware-wmi: printing the wrong error code 2020-01-27 14:50:47 +01:00
pnp
power power: supply: cpcap-battery: Fix signed counter sample register 2019-12-17 20:35:37 +01:00
powercap
pps
ps3
ptp ptp: free ptp device pin descriptors properly 2020-01-23 08:21:35 +01:00
pwm pwm: meson: Don't disable PWM when setting duty repeatedly 2020-01-27 14:50:47 +01:00
rapidio drivers/rapidio/rio_cm.c: fix potential oops in riocm_ch_listen() 2020-01-27 14:50:31 +01:00
ras
regulator regulator: tps65086: Fix tps65086_ldoa1_ranges for selector 0xB 2020-01-27 14:50:33 +01:00
remoteproc remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996 2020-01-27 14:50:10 +01:00
reset reset: Fix memory leak in reset_control_array_put() 2019-12-05 09:19:36 +01:00
rpmsg rpmsg: glink: Free pending deferred work on remove 2019-12-21 10:57:30 +01:00
rtc rtc: pcf8563: Clear event flags and disable interrupts before requesting irq 2020-01-27 14:50:56 +01:00
s390 s390/qeth: Fix vnicc_is_in_use if rx_bcast not set 2020-01-17 19:47:01 +01:00
sbus
scsi scsi: qla2xxx: Avoid that qlt_send_resp_ctio() corrupts memory 2020-01-27 14:50:42 +01:00
sfi
sh
siox
slimbus slimbus: ngd: Fix build error on x86 2019-12-13 08:51:54 +01:00
sn
soc soc: amlogic: meson-gx-pwrc-vpu: Fix power on/off register bitmask 2020-01-27 14:50:39 +01:00
soundwire soundwire: intel: fix PDI/stream mapping for Bulk 2019-12-31 16:35:55 +01:00
spi spi: spi-fsl-spi: call spi_finalize_current_message() at the end 2020-01-27 14:50:50 +01:00
spmi
ssb
staging staging: android: vsoc: fix copy_from_user overrun 2020-01-27 14:50:39 +01:00
target scsi: target/core: Fix a race condition in the LUN lookup code 2020-01-27 14:50:38 +01:00
tc
tee
thermal thermal: cpu_cooling: Actually trace CPU load in thermal_power_cpu_get_power 2020-01-27 14:50:48 +01:00
thunderbolt thunderbolt: Power cycle the router if NVM authentication fails 2019-12-05 09:21:27 +01:00
tty serial: stm32: fix a recursive locking in stm32_config_rs485 2020-01-27 14:50:54 +01:00
uio driver: uio: fix possible use-after-free in __uio_register_device 2020-01-27 14:50:17 +01:00
usb dwc2: gadget: Fix completed transfer size calculation in DDMA 2020-01-27 14:50:43 +01:00
uwb
vfio vfio/mdev: Fix aborting mdev child device removal if one fails 2020-01-27 14:50:46 +01:00
vhost vhost/vsock: accept only packets with the right dst_cid 2020-01-04 19:13:36 +01:00
video backlight: pwm_bl: Fix heuristic to determine number of brightness levels 2020-01-27 14:50:58 +01:00
virt
virtio virtio-balloon: fix managed page counts when migrating pages between zones 2019-12-17 20:34:43 +01:00
visorbus
vlynq
vme
w1 w1: IAD Register is yet readable trough iad sys file. Fix snprintf (%u for unsigned, count for max size). 2019-12-01 09:16:22 +01:00
watchdog watchdog: rtd119x_wdt: Fix remove function 2020-01-27 14:50:45 +01:00
xen xen, cpu_hotplug: Prevent an out of bounds access 2020-01-27 14:50:31 +01:00
zorro
Kconfig
Makefile