All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.4 01/40] staging: fwserial: Fix error handling in fwserial_create
@ 2021-02-24 12:53 ` Sasha Levin
  0 siblings, 0 replies; 63+ messages in thread
From: Sasha Levin @ 2021-02-24 12:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Dinghao Liu, Greg Kroah-Hartman, Sasha Levin, devel

From: Dinghao Liu <dinghao.liu@zju.edu.cn>

[ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ]

When fw_core_add_address_handler() fails, we need to destroy
the port by tty_port_destroy(). Also we need to unregister
the address handler by fw_core_remove_address_handler() on
failure.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao.liu@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/staging/fwserial/fwserial.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index aec0f19597a94..4df6e3c1ea96c 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -2189,6 +2189,7 @@ static int fwserial_create(struct fw_unit *unit)
 		err = fw_core_add_address_handler(&port->rx_handler,
 						  &fw_high_memory_region);
 		if (err) {
+			tty_port_destroy(&port->port);
 			kfree(port);
 			goto free_ports;
 		}
@@ -2271,6 +2272,7 @@ static int fwserial_create(struct fw_unit *unit)
 
 free_ports:
 	for (--i; i >= 0; --i) {
+		fw_core_remove_address_handler(&serial->ports[i]->rx_handler);
 		tty_port_destroy(&serial->ports[i]->port);
 		kfree(serial->ports[i]);
 	}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2021-02-24 14:41 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 12:53 [PATCH AUTOSEL 5.4 01/40] staging: fwserial: Fix error handling in fwserial_create Sasha Levin
2021-02-24 12:53 ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 02/40] x86/reboot: Add Zotac ZBOX CI327 nano PCI reboot quirk Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 03/40] vt/consolemap: do font sum unsigned Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 04/40] wlcore: Fix command execute failure 19 for wl12xx Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 05/40] Bluetooth: hci_h5: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for btrtl Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 06/40] pktgen: fix misuse of BUG_ON() in pktgen_thread_worker() Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 07/40] ath10k: fix wmi mgmt tx queue full due to race condition Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 08/40] x86/build: Treat R_386_PLT32 relocation as R_386_PC32 Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 09/40] Bluetooth: Fix null pointer dereference in amp_read_loc_assoc_final_data Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 10/40] staging: most: sound: add sanity check for function argument Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 11/40] staging: bcm2835-audio: Replace unsafe strcpy() with strscpy() Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 12/40] brcmfmac: Add DMI nvram filename quirk for Predia Basic tablet Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 13/40] brcmfmac: Add DMI nvram filename quirk for Voyo winpad A15 tablet Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 14/40] drm/hisilicon: Fix use-after-free Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 15/40] udlfb: Fix memory leak in dlfb_usb_probe Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 16/40] crypto: tcrypt - avoid signed overflow in byte count Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 17/40] drm/amdgpu: Add check to prevent IH overflow Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 18/40] PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 19/40] drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 20/40] media: mceusb: sanity check for prescaler value Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 21/40] media: v4l2-ctrls.c: fix shift-out-of-bounds in std_validate Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 22/40] media: uvcvideo: Allow entities with no pads Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 23/40] f2fs: handle unallocated section and zone on pinned/atgc Sasha Levin
2021-02-24 12:53   ` [f2fs-dev] " Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 24/40] f2fs: fix to set/clear I_LINKABLE under i_lock Sasha Levin
2021-02-24 12:53   ` [f2fs-dev] " Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 25/40] tomoyo: ignore data race while checking quota Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 26/40] nvme-core: add cancel tagset helpers Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 27/40] nvme-rdma: add clean action for failed reconnection Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 28/40] nvme-tcp: " Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 29/40] smackfs: restrict bytes count in smackfs write functions Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 30/40] Drivers: hv: vmbus: Resolve race condition in vmbus_onoffer_rescind() Sasha Levin
2021-02-24 13:20   ` Andrea Parri
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 31/40] ASoC: Intel: Add DMI quirk table to soc_intel_is_byt_cr() Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 32/40] btrfs: fix error handling in commit_fs_roots Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 33/40] perf/x86/kvm: Add Cascade Lake Xeon steppings to isolation_ucodes[] Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 34/40] erofs: fix shift-out-of-bounds of blkszbits Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 35/40] parisc: Bump 64-bit IRQ stack size to 64 KB Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 36/40] sched/features: Fix hrtick reprogramming Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 37/40] ASoC: Intel: bytcr_rt5640: Add quirk for the Estar Beauty HD MID 7316R tablet Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 38/40] ASoC: Intel: bytcr_rt5640: Add quirk for the Voyo Winpad A15 tablet Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 39/40] ASoC: Intel: bytcr_rt5651: Add quirk for the Jumper EZpad 7 tablet Sasha Levin
2021-02-24 12:53   ` Sasha Levin
2021-02-24 12:53 ` [PATCH AUTOSEL 5.4 40/40] ASoC: Intel: bytcr_rt5640: Add quirk for the Acer One S1002 tablet Sasha Levin
2021-02-24 12:53   ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.