linux-stable/drivers
Dan Carpenter cef09673c3 serial: core: fix -EPROBE_DEFER handling in init
The -EPROBE_DEFER error path in serial_base_device_init() is a bit
awkward.  Before the call to device_initialize(dev) then we need to
manually release all the device resources.  And after the call then we
need to call put_device() to release the resources.  Doing either one
wrong will result in a leak or a use after free.

So let's wait to return -EPROBE_DEFER until after the call to
device_initialize(dev) so that way callers do not have to handle
-EPROBE_DEFER as a special case.  Now callers can just use put_device()
for clean up.

The second issue with the -EPROBE_DEFER path is that deferring is not
supposed to be a fatal error, but instead it's normal part of the
init process and the kernel recovers from it automatically.  That means
we should not print an error message but just a debug message on this
path.

Fixes: 539914240a ("serial: core: Fix probing serial_base_bus devices")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Message-ID: <18318adb-ab2c-4dcc-9f96-498a13d16b80@moroto.mountain>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 12:20:51 +02:00
..
accel accel/qaic: Fix NNC message corruption 2023-05-23 09:51:38 -06:00
accessibility
acpi First batch of EFI fixes for v6.4: 2023-06-01 20:43:11 -04:00
amba
android binder: fix UAF of alloc->vma in race with munmap() 2023-05-20 17:56:23 +01:00
ata ata: libata-scsi: Use correct device no in ata_find_dev() 2023-05-30 08:08:18 +09:00
atm
auxdisplay
base Char/Misc driver fixes for 6.4-rc5 2023-06-04 08:32:30 -04:00
bcma
block xen: branch for v6.4-rc4 2023-05-27 09:42:56 -07:00
bluetooth Bluetooth: btnxpuart: Fix compiler warnings 2023-05-19 15:38:29 -07:00
bus
cdrom
cdx
char tpm, tpm_tis: correct tpm_tis_flags enumeration values 2023-06-02 17:35:22 -04:00
clk A couple more patches that would be good to get into -rc1. 2023-05-07 10:31:45 -07:00
clocksource
comedi
connector
counter
cpufreq cpufreq: amd-pstate: Update policy->cur in amd_pstate_adjust_perf() 2023-05-25 19:35:13 +02:00
cpuidle
crypto This push fixes the following problems: 2023-05-07 10:57:14 -07:00
cxl cxl: Explicitly initialize resources when media is not ready 2023-05-26 13:34:39 -07:00
dax
dca
devfreq
dio
dma dmaengine: at_hdmac: Extend the Flow Controller bitfield to three bits 2023-05-24 11:20:28 +05:30
dma-buf
edac
eisa
extcon
firewire firewire: net: fix unexpected release of object for asynchronous request packet 2023-05-11 09:06:49 +09:00
firmware First batch of EFI fixes for v6.4: 2023-06-01 20:43:11 -04:00
fpga
fsi
gnss
gpio gpio-f7188x: fix chip name and pin count on Nuvoton chip 2023-05-23 10:47:41 +02:00
gpu Merge tag 'drm-intel-fixes-2023-06-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes 2023-06-02 10:33:29 +10:00
greybus
hid for-linus-2023060101 2023-06-01 09:02:04 -04:00
hsi
hte
hv
hwmon hwmon: (k10temp) Add PCI ID for family 19, model 78h 2023-05-08 11:36:19 +02:00
hwspinlock
hwtracing coresight: perf: Release Coresight path when alloc trace id failed 2023-05-11 11:18:21 +01:00
i2c
i3c
idle
iio iio: imu: inv_icm42600: fix timestamp reset 2023-05-20 17:33:14 +01:00
infiniband RDMA/irdma: Fix Local Invalidate fencing 2023-05-29 14:06:29 -03:00
input
interconnect
iommu iommu/mediatek: Flush IOTLB completely only if domain has been attached 2023-06-01 11:50:13 +02:00
ipack
irqchip irqchip/gic: Correctly validate OF quirk descriptors 2023-05-30 11:01:22 +01:00
isdn Including fixes from netfilter. 2023-05-05 19:12:01 -07:00
leds leds: qcom-lpg: Fix PWM period limits 2023-06-03 17:00:28 +02:00
macintosh
mailbox mailbox: mailbox-test: fix a locking issue in mbox_test_message_write() 2023-05-31 13:26:44 -05:00
mcb
md md/raid5: fix miscalculation of 'end_sector' in raid5_read_one_chunk() 2023-05-24 10:44:19 -07:00
media media: uvcvideo: Don't expose unsupported formats to userspace 2023-06-02 18:48:02 +01:00
memory
memstick
message
mfd
misc misc: fastrpc: reject new invocations during device removal 2023-05-29 15:09:50 +01:00
mmc mmc: pwrseq: sd8787: Fix WILC CHIP_EN and RESETN toggling order 2023-05-24 14:33:32 +02:00
most
mtd mtd: rawnand: marvell: don't set the NAND frequency select 2023-06-01 18:12:33 +02:00
mux
net mlx5-fixes-2023-05-31 2023-06-01 10:15:43 -07:00
nfc nfcsim.c: Fix error checking for debugfs_create_dir 2023-05-26 12:18:35 +01:00
ntb
nubus
nvdimm
nvme nvme: fix the name of Zone Append for verbose logging 2023-05-31 09:21:26 -07:00
nvmem
of Devicetree fixes for 6.4, part 1: 2023-05-05 13:27:59 -07:00
opp
parisc
parport
pci PCI/DPC: Quirk PIO log size for Intel Ice Lake Root Ports 2023-05-11 17:38:46 -05:00
pcmcia
peci
perf
phy phy: qcom-snps: correct struct qcom_snps_hsphy kerneldoc 2023-05-16 19:48:55 +05:30
pinctrl
platform platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain 2023-05-23 12:55:16 +02:00
pnp
power power: supply: Fix logic checking if system is running from battery 2023-05-16 23:02:56 +02:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: mt6359: add read check for PMIC MT6359 2023-05-18 19:24:47 +09:00
remoteproc
reset
rpmsg
rtc
s390 block-6.4-2023-05-20 2023-05-20 08:48:04 -07:00
sbus
scsi scsi: stex: Fix gcc 13 warnings 2023-05-31 11:36:40 -04:00
sh
siox
slimbus
soc soc: fsl: cpm1: Fix TSA and QMC dependencies in case of COMPILE_TEST 2023-05-30 12:25:25 +01:00
soundwire
spi spi: spi-cadence: Interleave write of TX and read of RX FIFO 2023-05-22 11:41:05 +01:00
spmi
ssb
staging media: staging: media: imx: initialize hs_settle to avoid warning 2023-06-02 18:45:52 +01:00
target scsi: target: iscsi: Prevent login threads from racing between each other 2023-05-22 16:29:39 -04:00
tc
tee Fixes an uninitialized variable in OP-TEE driver 2023-05-25 17:16:52 +02:00
thermal thermal: intel: int340x: Add new line for UUID display 2023-05-24 19:50:04 +02:00
thunderbolt thunderbolt: Clear registers properly when auto clear isn't in use 2023-05-09 09:39:03 +03:00
tty serial: core: fix -EPROBE_DEFER handling in init 2023-06-15 12:20:51 +02:00
ufs scsi: ufs: core: Fix MCQ nr_hw_queues 2023-05-16 21:07:26 -04:00
uio
usb usb: typec: tps6598x: Fix broken polling mode after system suspend/resume 2023-05-30 15:29:41 +01:00
vdpa
vfio vfio/type1: check pfn valid before converting to struct page 2023-05-23 14:16:29 -06:00
vhost fork, vhost: Use CLONE_THREAD to fix freezer/ps regression 2023-06-01 17:15:33 -04:00
video fbdev: bw2: Convert to platform remove callback returning void 2023-05-30 18:33:25 +02:00
virt
virtio
vlynq
w1
watchdog
xen xen: branch for v6.4-rc4 2023-05-27 09:42:56 -07:00
zorro
Kconfig
Makefile