From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Johan Hovold <johan+linaro@kernel.org>,
Zijun Hu <quic_zijuhu@quicinc.com>, Vinod Koul <vkoul@kernel.org>
Subject: [PATCH 6.6 15/86] phy: core: Fix an OF node refcount leakage in _of_phy_get()
Date: Mon, 30 Dec 2024 16:42:23 +0100 [thread overview]
Message-ID: <20241230154212.295378648@linuxfoundation.org> (raw)
In-Reply-To: <20241230154211.711515682@linuxfoundation.org>
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <quic_zijuhu@quicinc.com>
commit 5ebdc6be16c2000e37fcb8b4072d442d268ad492 upstream.
_of_phy_get() will directly return when suffers of_device_is_compatible()
error, but it forgets to decrease refcount of OF node @args.np before error
return, the refcount was increased by previous of_parse_phandle_with_args()
so causes the OF node's refcount leakage.
Fix by decreasing the refcount via of_node_put() before the error return.
Fixes: b7563e2796f8 ("phy: work around 'phys' references to usb-nop-xceiv devices")
Cc: stable@vger.kernel.org
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20241213-phy_core_fix-v6-4-40ae28f5015a@quicinc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/phy/phy-core.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -577,8 +577,10 @@ static struct phy *_of_phy_get(struct de
return ERR_PTR(-ENODEV);
/* This phy type handled by the usb-phy subsystem for now */
- if (of_device_is_compatible(args.np, "usb-nop-xceiv"))
- return ERR_PTR(-ENODEV);
+ if (of_device_is_compatible(args.np, "usb-nop-xceiv")) {
+ phy = ERR_PTR(-ENODEV);
+ goto out_put_node;
+ }
mutex_lock(&phy_provider_mutex);
phy_provider = of_phy_provider_lookup(args.np);
@@ -600,6 +602,7 @@ out_put_module:
out_unlock:
mutex_unlock(&phy_provider_mutex);
+out_put_node:
of_node_put(args.np);
return phy;
next prev parent reply other threads:[~2024-12-30 15:48 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-30 15:42 [PATCH 6.6 00/86] 6.6.69-rc1 review Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 01/86] media: dvb-frontends: dib3000mb: fix uninit-value in dib3000_write_reg Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 02/86] ceph: try to allocate a smaller extent map for sparse read Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 03/86] ceph: fix memory leak in ceph_direct_read_write() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 04/86] ceph: allocate sparse_ext map only for sparse reads Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 05/86] mm/vmstat: fix a W=1 clang compiler warning Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 06/86] tcp_bpf: Charge receive socket buffer in bpf_tcp_ingress() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 07/86] tcp_bpf: Add sk_rmem_alloc related logic for tcp_bpf ingress redirection Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 08/86] bpf: Check negative offsets in __bpf_skb_min_len() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 09/86] nfsd: Revert "nfsd: release svc_expkey/svc_export with rcu_work" Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 10/86] nfsd: restore callback functionality for NFSv4.0 Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 11/86] mtd: diskonchip: Cast an operand to prevent potential overflow Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 12/86] mtd: rawnand: arasan: Fix double assertion of chip-select Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 13/86] mtd: rawnand: arasan: Fix missing de-registration of NAND Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 14/86] phy: qcom-qmp: Fix register name in RX Lane config of SC8280XP Greg Kroah-Hartman
2024-12-30 15:42 ` Greg Kroah-Hartman [this message]
2024-12-30 15:42 ` [PATCH 6.6 16/86] phy: core: Fix an OF node refcount leakage in of_phy_provider_lookup() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 17/86] phy: core: Fix that API devm_phy_put() fails to release the phy Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 18/86] phy: core: Fix that API devm_of_phy_provider_unregister() fails to unregister the phy provider Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 19/86] phy: core: Fix that API devm_phy_destroy() fails to destroy the phy Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 20/86] phy: usb: Toggle the PHY power during init Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 21/86] phy: rockchip: naneng-combphy: fix phy reset Greg Kroah-Hartman
2025-01-29 13:27 ` [REGRESSION] USB 3 and PCIe broken on rk356x due to missing " Jan Čermák
2025-01-29 13:36 ` Greg Kroah-Hartman
2025-01-29 13:50 ` Jan Čermák
2025-01-29 13:55 ` Heiko Stübner
2025-01-29 18:41 ` Vinod Koul
2025-01-29 21:06 ` Heiko Stübner
2024-12-30 15:42 ` [PATCH 6.6 22/86] dmaengine: mv_xor: fix child node refcount handling in early exit Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 23/86] dmaengine: dw: Select only supported masters for ACPI devices Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 24/86] dmaengine: tegra: Return correct DMA status when paused Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 25/86] dmaengine: fsl-edma: implement the cleanup path of fsl_edma3_attach_pd() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 26/86] dmaengine: apple-admac: Avoid accessing registers in probe Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 27/86] dmaengine: at_xdmac: avoid null_prt_deref in at_xdmac_prep_dma_memset Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 28/86] mtd: rawnand: fix double free in atmel_pmecc_create_user() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 29/86] powerpc/pseries/vas: Add close() callback in vas_vm_ops struct Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 30/86] stddef: make __struct_group() UAPI C++-friendly Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 31/86] tracing/kprobe: Make trace_kprobes module callback called after jump_label update Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 32/86] watchdog: it87_wdt: add PWRGD enable quirk for Qotom QCML04 Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 33/86] watchdog: mediatek: Add support for MT6735 TOPRGU/WDT Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 34/86] scsi: qla1280: Fix hw revision numbering for ISP1020/1040 Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 35/86] scsi: megaraid_sas: Fix for a potential deadlock Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 36/86] udf: Skip parent dir link count update if corrupted Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 37/86] ALSA: hda/conexant: fix Z60MR100 startup pop issue Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 38/86] ALSA: sh: Use standard helper for buffer accesses Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 39/86] smb: server: Fix building with GCC 15 Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 40/86] regmap: Use correct format specifier for logging range errors Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 41/86] LoongArch: Fix reserving screen info memory for above-4G firmware Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 42/86] LoongArch: BPF: Adjust the parameter of emit_jirl() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 43/86] platform/x86: asus-nb-wmi: Ignore unknown event 0xCF Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 44/86] spi: intel: Add Panther Lake SPI controller support Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 45/86] scsi: mpt3sas: Diag-Reset when Doorbell-In-Use bit is set during driver load time Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 46/86] scsi: storvsc: Do not flag MAINTENANCE_IN return of SRB_STATUS_DATA_OVERRUN as an error Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 47/86] spi: omap2-mcspi: Fix the IS_ERR() bug for devm_clk_get_optional_enabled() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 48/86] drm/dp_mst: Ensure mst_primary pointer is valid in drm_dp_mst_handle_up_req() Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 49/86] virtio-blk: dont keep queue frozen during system suspend Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 50/86] blk-mq: register cpuhp callback after hctx is added to xarray table Greg Kroah-Hartman
2024-12-30 15:42 ` [PATCH 6.6 51/86] blk-mq: move cpuhp callback registering out of q->sysfs_lock Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 52/86] MIPS: Probe toolchain support of -msym32 Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 53/86] MIPS: mipsregs: Set proper ISA level for virt extensions Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 54/86] sched/task_stack: fix object_is_on_stack() for KASAN tagged pointers Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 55/86] ALSA: hda/realtek: fix mute/micmute LEDs dont work for EliteBook X G1i Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 56/86] ALSA: hda/realtek: fix micmute LEDs dont work on HP Laptops Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 57/86] pmdomain: core: Add missing put_device() Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 58/86] drm/amd/amdgpu: allow use kiq to do hdp flush under sriov Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 59/86] drm/amdgpu/hdp4.0: do a posting read when flushing HDP Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 60/86] drm/amdgpu/hdp5.0: " Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 61/86] drm/amdgpu/hdp6.0: " Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 62/86] x86/cpu: Add model number for Intel Clearwater Forest processor Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 63/86] x86/cpu: Add model number for another Intel Arrow Lake mobile processor Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 64/86] x86/cpu/vfm: Add/initialize x86_vfm field to struct cpuinfo_x86 Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 65/86] x86/cpu/vfm: Update arch/x86/include/asm/intel-family.h Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 66/86] x86/cpu/intel: Switch to new Intel CPU model defines Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 67/86] x86/cpu: Add Lunar Lake to list of CPUs with a broken MONITOR implementation Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 68/86] drm/amdkfd: reduce stack size in kfd_topology_add_device() Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 69/86] drm/amdkfd: drop struct kfd_cu_info Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 70/86] drm/amdkfd: Use device based logging for errors Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 71/86] drm/amdkfd: pause autosuspend when creating pdd Greg Kroah-Hartman
2024-12-30 16:04 ` Li, Yunxiang (Teddy)
2025-01-02 9:32 ` Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 72/86] freezer, sched: Report frozen tasks as D instead of R Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 73/86] tracing: Constify string literal data member in struct trace_event_call Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 74/86] tracing: Prevent bad count for tracing_cpumask_write Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 75/86] io_uring/sqpoll: fix sqpoll error handling races Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 76/86] i2c: microchip-core: actually use repeated sends Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 77/86] PCI/MSI: Handle lack of irqdomain gracefully Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 78/86] i2c: imx: add imx7d compatible string for applying erratum ERR007805 Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 79/86] i2c: microchip-core: fix "ghost" detections Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 80/86] power: supply: gpio-charger: Fix set charge current limits Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 81/86] btrfs: avoid monopolizing a core when activating a swap file Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 82/86] btrfs: sysfs: fix direct super block member reads Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 83/86] ALSA: sh: Fix wrong argument order for copy_from_iter() Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 84/86] x86/cpu/intel: Drop stray FAM6 check with new Intel CPU model defines Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 85/86] ALSA: hda/realtek: Fix spelling mistake "Firelfy" -> "Firefly" Greg Kroah-Hartman
2024-12-30 15:43 ` [PATCH 6.6 86/86] block: avoid to reuse `hctx` not removed from cpuhp callback list Greg Kroah-Hartman
2024-12-30 17:51 ` [PATCH 6.6 00/86] 6.6.69-rc1 review Florian Fainelli
2024-12-30 20:58 ` Shuah Khan
2024-12-31 8:12 ` Muhammad Usama Anjum
2024-12-31 9:39 ` Naresh Kamboju
2024-12-31 13:03 ` Harshit Mogalapalli
2024-12-31 22:35 ` [PATCH 6.6] " Hardik Garg
2024-12-31 22:54 ` [PATCH 6.6 00/86] " Ron Economos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241230154212.295378648@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=johan+linaro@kernel.org \
--cc=patches@lists.linux.dev \
--cc=quic_zijuhu@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox