When typec_altmode_put_partner is called by a plug altmode upon release,
the port altmode the plug belongs to will not remove its reference to the
plug. The check to see if the altmode being released evaluates against the
released altmode's partner instead of the calling altmode itself, so change
adev in typec_altmode_put_partner to properly refer to the altmode being
released.
typec_altmode_set_partner is not run for port altmodes, so also add a check
in typec_altmode_release to prevent typec_altmode_put_partner() calls on
port altmode release.
---
Changes since v1:
* Changed commit message for clarity
* Added check to typec_altmode_release to only call put_partner if altmode
belongs to port partner or plug
---
Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes")
Cc: stable(a)vger.kernel.org
Signed-off-by: RD Babiera <rdbabiera(a)google.com>
---
drivers/usb/typec/class.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index 2e0451bd336e..16a670828dde 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -267,7 +267,7 @@ static void typec_altmode_put_partner(struct altmode *altmode)
if (!partner)
return;
- adev = &partner->adev;
+ adev = &altmode->adev;
if (is_typec_plug(adev->dev.parent)) {
struct typec_plug *plug = to_typec_plug(adev->dev.parent);
@@ -497,7 +497,8 @@ static void typec_altmode_release(struct device *dev)
{
struct altmode *alt = to_altmode(to_typec_altmode(dev));
- typec_altmode_put_partner(alt);
+ if (!is_typec_port(dev->parent))
+ typec_altmode_put_partner(alt);
altmode_id_remove(alt->adev.dev.parent, alt->id);
kfree(alt);
base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86
--
2.43.0.rc1.413.gea7ed67945-goog
This is the start of the stable review cycle for the 4.19.300 release.
There are 92 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Tue, 28 Nov 2023 15:43:06 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.300-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.300-rc3
Eric Dumazet <edumazet(a)google.com>
net: sched: fix race condition in qdisc_graft()
Matthew Wilcox (Oracle) <willy(a)infradead.org>
iomap: Set all uptodate bits for an Uptodate page
Dongli Zhang <dongli.zhang(a)oracle.com>
scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids
Christian König <christian.koenig(a)amd.com>
drm/amdgpu: fix error handling in amdgpu_bo_list_get()
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct return value of ext4_convert_meta_bg
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct offset of gdb backup in non meta_bg group to update_backups
Max Kellermann <max.kellermann(a)ionos.com>
ext4: apply umask if ACL support is disabled
Heiner Kallweit <hkallweit1(a)gmail.com>
Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E"
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to handle capabilities from firmware
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: fix the check to handle session buffer requirement
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi_parser: Add check to keep the number of codecs within range
Sean Young <sean(a)mess.org>
media: sharp: fix sharp encoding
Sean Young <sean(a)mess.org>
media: lirc: drop trailing space from scancode transmit
Heiner Kallweit <hkallweit1(a)gmail.com>
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
Alexander Sverdlin <alexander.sverdlin(a)siemens.com>
net: dsa: lan9303: consequently nested-lock physical MDIO
Pavel Krasavin <pkrasavin(a)imaqliq.com>
tty: serial: meson: fix hard LOCKUP on crtscts mode
Lad Prabhakar <prabhakar.mahadev-lad.rj(a)bp.renesas.com>
serial: meson: Use platform_get_irq() to get the interrupt
Neil Armstrong <narmstrong(a)baylibre.com>
tty: serial: meson: retrieve port FIFO size from DT
Colin Ian King <colin.king(a)canonical.com>
serial: meson: remove redundant initialization of variable id
Loys Ollivier <lollivier(a)baylibre.com>
tty: serial: meson: if no alias specified use an available id
Chandradeep Dey <codesigning(a)chandradeepdey.com>
ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC
Takashi Iwai <tiwai(a)suse.de>
ALSA: info: Fix potential deadlock at disconnection
Helge Deller <deller(a)gmx.de>
parisc/pgtable: Do not drop upper 5 address bits of physical address
Helge Deller <deller(a)gmx.de>
parisc: Prevent booting 64-bit kernels on PA1.x machines
Alain Volmat <alain.volmat(a)foss.st.com>
dmaengine: stm32-mdma: correct desc prep when channel running
Sanjuán García, Jorge <Jorge.SanjuanGarcia(a)duagon.com>
mcb: fix error handling for different scenarios when parsing
Eric Biggers <ebiggers(a)google.com>
quota: explicitly forbid quota files from being encrypted
Zhihao Cheng <chengzhihao1(a)huawei.com>
jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Use __get_safe_page() rather than touching the list
Dan Carpenter <dan.carpenter(a)linaro.org>
mmc: vub300: fix an error code
Kathiravan Thirumoorthy <quic_kathirav(a)quicinc.com>
clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks
Helge Deller <deller(a)gmx.de>
parisc/pdc: Add width field to struct pdc_model
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .probe() callback
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .remove() callback
Herve Codina <herve.codina(a)bootlin.com>
genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
Rong Chen <rong.chen(a)amlogic.com>
mmc: meson-gx: Remove setting of CMD_CFG_ERROR
Lukas Wunner <lukas(a)wunner.de>
PCI/sysfs: Protect driver's D3cold preference from user space
David Woodhouse <dwmw(a)amazon.co.uk>
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
Paul Moore <paul(a)paul-moore.com>
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Paul Moore <paul(a)paul-moore.com>
audit: don't take task_lock() in audit_exe_compare() code path
Maciej S. Szmigiero <maciej.szmigiero(a)oracle.com>
KVM: x86: Ignore MSR_AMD64_TW_CFG access
Kees Cook <keescook(a)chromium.org>
randstruct: Fix gcc-plugin performance mode to stay in group
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to perform sanity on queue pointers
Anastasia Belova <abelova(a)astralinux.ru>
cifs: spnego: add ';' in HOST_KEY_LEN
Vlad Buslov <vladbu(a)nvidia.com>
macvlan: Don't propagate promisc change to lower dev in passthru
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix MTU max setting
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Handle large frames
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix max RX frame define
Eric Dumazet <edumazet(a)google.com>
ptp: annotate data-race around q->head and q->tail
Juergen Gross <jgross(a)suse.com>
xen/events: fix delayed eoi list handling
Willem de Bruijn <willemb(a)google.com>
ppp: limit MRU to 64K
Shigeru Yoshida <syoshida(a)redhat.com>
tipc: Fix kernel-infoleak due to uninitialized TLV value
Shigeru Yoshida <syoshida(a)redhat.com>
tty: Fix uninit-value access in ppp_sync_receive()
Eric Dumazet <edumazet(a)google.com>
ipvlan: add ipvlan_route_v6_outbound() helper
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
Dan Carpenter <dan.carpenter(a)linaro.org>
pwm: Fix double shift bug
Wayne Lin <wayne.lin(a)amd.com>
drm/amd/display: Avoid NULL dereference of timing generator
Bob Peterson <rpeterso(a)redhat.com>
gfs2: ignore negated quota changes
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: avoid integer overflow
Rajeshwar R Shinde <coolrrsh(a)gmail.com>
media: gspca: cpia1: shift-out-of-bounds in set_flicker
Axel Lin <axel.lin(a)ingics.com>
i2c: sun6i-p2wi: Prevent potential division by zero
Hardik Gajjar <hgajjar(a)de.adit-jv.com>
usb: gadget: f_ncm: Always set current gadget in ncm_bind()
Yi Yang <yiyang13(a)huawei.com>
tty: vcc: Add check for kstrdup() in vcc_probe()
Jiri Kosina <jkosina(a)suse.cz>
HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W
Wenchao Hao <haowenchao2(a)huawei.com>
scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
atm: iphase: Do PCI error checks on own line
Cezary Rojewski <cezary.rojewski(a)intel.com>
ALSA: hda: Fix possible null-ptr-deref when assigning a stream
Vincent Whitchurch <vincent.whitchurch(a)axis.com>
ARM: 9320/1: fix stack depot IRQ stack filter
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in diAlloc
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in dbFindLeaf
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add validity check for db_maxag and db_agpref
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add check for negative db_l2nbperpage
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
RDMA/hfi1: Use FIELD_GET() to extract Link Width
Lu Jialin <lujialin4(a)huawei.com>
crypto: pcrypt - Fix hungtask for PADATA_RESET
zhujun2 <zhujun2(a)cmss.chinamobile.com>
selftests/efivarfs: create-read: fix a resource leak
Qu Huang <qu.huang(a)linux.dev>
drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7
Olli Asikainen <olli.asikainen(a)gmail.com>
platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e
ZhengHan Wang <wzhmmmmm(a)gmail.com>
Bluetooth: Fix double free in hci_conn_cleanup
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_dst_pending_confirm
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_tx_queue_mapping
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath10k: fix clang-specific fortify warning
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath9k: fix clang-specific fortify warnings
Ping-Ke Shih <pkshih(a)realtek.com>
wifi: mac80211: don't return unset power in ieee80211_get_tx_power()
Mike Rapoport (IBM) <rppt(a)kernel.org>
x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
Ronald Wahl <ronald.wahl(a)raritan.com>
clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware
Jacky Bai <ping.bai(a)nxp.com>
clocksource/drivers/timer-imx-gpt: Fix potential memory leak
Shuai Xue <xueshuai(a)linux.alibaba.com>
perf/core: Bail out early if the request AUX area is out of bound
John Stultz <jstultz(a)google.com>
locking/ww_mutex/test: Fix potential workqueue corruption
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/exception.h | 4 --
arch/parisc/include/uapi/asm/pdc.h | 1 +
arch/parisc/kernel/entry.S | 7 ++--
arch/parisc/kernel/head.S | 5 +--
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/numa.h | 7 ----
arch/x86/kvm/x86.c | 2 +
arch/x86/mm/numa.c | 7 ----
crypto/pcrypt.c | 4 ++
drivers/atm/iphase.c | 20 +++++-----
drivers/clk/qcom/gcc-ipq8074.c | 6 ---
drivers/clocksource/tcb_clksrc.c | 1 +
drivers/clocksource/timer-imx-gpt.c | 18 ++++++---
drivers/dma/stm32-mdma.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +++
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +-
drivers/gpu/drm/amd/include/pptable.h | 4 +-
drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h | 16 ++++----
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-quirks.c | 1 +
drivers/i2c/busses/i2c-i801.c | 19 +++++----
drivers/i2c/busses/i2c-sun6i-p2wi.c | 5 +++
drivers/infiniband/hw/hfi1/pcie.c | 9 +----
drivers/mcb/mcb-core.c | 1 +
drivers/mcb/mcb-parse.c | 2 +-
drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +-
drivers/media/platform/qcom/venus/hfi_parser.c | 15 ++++++++
drivers/media/platform/qcom/venus/hfi_venus.c | 10 +++++
drivers/media/platform/vivid/vivid-rds-gen.c | 2 +-
drivers/media/rc/ir-sharp-decoder.c | 8 ++--
drivers/media/rc/lirc_dev.c | 6 ++-
drivers/media/usb/gspca/cpia1.c | 3 ++
drivers/mmc/host/meson-gx-mmc.c | 1 -
drivers/mmc/host/vub300.c | 1 +
drivers/net/dsa/lan9303_mdio.c | 4 +-
drivers/net/ethernet/cortina/gemini.c | 45 ++++++++++++++--------
drivers/net/ethernet/cortina/gemini.h | 4 +-
drivers/net/ethernet/realtek/r8169_main.c | 4 +-
drivers/net/ipvlan/ipvlan_core.c | 41 ++++++++++++--------
drivers/net/macvlan.c | 2 +-
drivers/net/ppp/ppp_synctty.c | 6 ++-
drivers/net/wireless/ath/ath10k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
drivers/pci/controller/dwc/pci-keystone.c | 8 ++--
drivers/pci/pci-acpi.c | 2 +-
drivers/pci/pci-sysfs.c | 5 +--
drivers/platform/x86/thinkpad_acpi.c | 1 +
drivers/ptp/ptp_chardev.c | 3 +-
drivers/ptp/ptp_clock.c | 5 ++-
drivers/ptp/ptp_private.h | 8 +++-
drivers/ptp/ptp_sysfs.c | 3 +-
drivers/scsi/libfc/fc_lport.c | 6 +++
drivers/scsi/virtio_scsi.c | 1 +
drivers/tty/hvc/hvc_xen.c | 5 ++-
drivers/tty/serial/meson_uart.c | 44 ++++++++++++++++-----
drivers/tty/vcc.c | 16 ++++++--
drivers/usb/gadget/function/f_ncm.c | 27 ++++++-------
drivers/xen/events/events_base.c | 4 +-
fs/cifs/cifs_spnego.c | 4 +-
fs/ext4/acl.h | 5 +++
fs/ext4/resize.c | 19 ++++-----
fs/gfs2/quota.c | 11 ++++++
fs/iomap.c | 3 ++
fs/jbd2/recovery.c | 8 ++++
fs/jfs/jfs_dmap.c | 23 ++++++++---
fs/jfs/jfs_imap.c | 5 ++-
fs/nfs/nfs4proc.c | 5 ++-
fs/quota/dquot.c | 14 +++++++
include/linux/pwm.h | 4 +-
include/net/sock.h | 26 +++++++++----
kernel/audit_watch.c | 9 ++++-
kernel/events/ring_buffer.c | 6 +++
kernel/irq/generic-chip.c | 25 +++++++++---
kernel/locking/test-ww_mutex.c | 20 ++++++----
kernel/padata.c | 2 +-
kernel/power/snapshot.c | 16 ++++----
net/bluetooth/hci_conn.c | 6 +--
net/bluetooth/hci_sysfs.c | 23 +++++------
net/core/sock.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/mac80211/cfg.c | 4 ++
net/sched/sch_api.c | 5 ++-
net/tipc/netlink_compat.c | 1 +
scripts/gcc-plugins/randomize_layout_plugin.c | 11 ++++--
sound/core/info.c | 21 ++++++----
sound/hda/hdac_stream.c | 6 ++-
sound/pci/hda/patch_realtek.c | 1 +
tools/testing/selftests/efivarfs/create-read.c | 2 +
91 files changed, 482 insertions(+), 265 deletions(-)