| Message ID | 20260916182412.2091681-1-vulab@iscas.ac.cn (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-25998-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 83D031C02B3 for <noreply@patchwork.local>; Wed, 16 Sep 2026 20:25:03 +0200 (CEST) Authentication-Results: mxe881; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-25998-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-25998-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 67C1560205E for <noreply@patchwork.local>; Wed, 16 Sep 2026 18:24:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CC444C33EC; Wed, 16 Sep 2026 18:24:55 +0000 (UTC) X-Original-To: linux-sunxi@lists.linux.dev Received: from cstnet.cn (smtp25.cstnet.cn [159.226.251.25]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AABEB4B8272 for <linux-sunxi@lists.linux.dev>; Wed, 16 Sep 2026 18:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789583094; cv=none; b=Wy88ds7h5IegFuLl+ut4o1t6SxUFa/7hH1WxA++2e3qbdEsQtkWxRiZu7ezQXPMJTXS8XyCeHqqo4f0GcvdRs/Ptx6XTDazcRh+THu4J76zLuNk0ci3QcN7IyPKBh7+Eg0BLEjLyRJn4lO7X235Z+QT3YLF6tG4SecHRO5EhDic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789583094; c=relaxed/simple; bh=plb//BthYcXLQATz/pBSy5f+m6949UjkGPuUQG86j1s=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FYJOM/lHZZIzWT9LJsvCOwUJ9iy/JGKiK7IXyvmbyjpLTWgohuJcQfW7FYGQ2t9L3EX4YSGBRrmgVjrunD+NFQPzUu+lqTemtJsDwncoRjCGnHGrMfl35KNZMdIUSZMmBeigZ/ZDYSTTJOlOGxMwLSk2qs/733BepbNdoTSniXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from dfae2b116770.home.arpa (unknown [36.110.52.2]) by APP-05 (Coremail) with SMTP id zQCowABn0Tvo3qpqV3ZvCA--.24596S2; Thu, 17 Sep 2026 02:24:40 +0800 (CST) From: Wentao Liang <vulab@iscas.ac.cn> To: airlied@gmail.com Cc: dri-devel@lists.freedesktop.org, jernej.skrabec@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, maarten.lankhorst@linux.intel.com, mripard@kernel.org, samuel@sholland.org, simona@ffwll.ch, tzimmermann@suse.de, wens@kernel.org, Wentao Liang <vulab@iscas.ac.cn>, stable@vger.kernel.org Subject: [PATCH] drm/sun4i: Fix pdev reference leak in sun8i_r40_tcon_tv_set_mux() Date: Wed, 16 Sep 2026 18:24:12 +0000 Message-Id: <20260916182412.2091681-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: <linux-sunxi.lists.linux.dev> List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowABn0Tvo3qpqV3ZvCA--.24596S2 X-Coremail-Antispam: 1UD129KBjvdXoW7XF4rWr1UKF18ZrWxur1kAFb_yoW3urb_W3 95urnxZr1kGr98AFy2vr1YvFyS9FnxWFW8Xw17tayrJ345ZrWIqr95twn5Xw4jqFyxWFn8 twnrWa1qyw12gjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb-xFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j 6F4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26F 4UJVW0owAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUAVWUtwAv7VC2z280aVAFwI0_Cr0_Gr1UMcvjeVCFs4IE7xkEbV WUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7Cj xVA2Y2ka0xkIwI1lc7CjxVAaw2AFwI0_Jw0_GFyl42xK82IYc2Ij64vIr41l4I8I3I0E4I kC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWU WwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_JF I_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcVCF04k26cxKx2IYs7xG 6r1j6r1xMIIF0xvEx4A2jsIE14v26F4j6r4UJwCI42IY6I8E87Iv6xkF7I0E14v26F4UJV W0obIYCTnIWIevJa73UjIFyTuYvjfUw5l8UUUUU X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCRMMA2qqozWCnQAAsc X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [2.34 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RECEIVED_SPAMHAUS_XBL(3.00)[36.110.52.2:received]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.90.174.1:received,159.226.251.25:received]; RCPT_COUNT_TWELVE(0.00)[14]; DBL_BLOCKED_OPENRESOLVER(0.00)[iscas.ac.cn:email,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; DMARC_NA(0.00)[iscas.ac.cn]; FORGED_SENDER_MAILLIST(0.00)[]; FREEMAIL_CC(0.00)[lists.freedesktop.org,gmail.com,lists.infradead.org,vger.kernel.org,lists.linux.dev,linux.intel.com,kernel.org,sholland.org,ffwll.ch,suse.de,iscas.ac.cn]; PRECEDENCE_BULK(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[vulab@iscas.ac.cn,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[bounces-25998-noreply=patchwork.local]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.232.135.74:from] X-Rspamd-Queue-Id: 83D031C02B3 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= |
| Series |
drm/sun4i: Fix pdev reference leak in sun8i_r40_tcon_tv_set_mux()
|
|
Commit Message
Wentao Liang
Sept. 16, 2026, 6:24 p.m. UTC
of_find_device_by_node() takes a reference to the TCON TOP device
which the error paths release, but the success path returns without
doing so. Drop the reference before returning success.
Fixes: 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 ++
1 file changed, 2 insertions(+)
Comments
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] drm/sun4i: misapplied patch causes build failure
--
commit 576ab0ea69ae3e401d6153bcb00f1e660850ae75
Author: Wentao Liang <vulab@iscas.ac.cn>
drm/sun4i: Fix pdev reference leak in sun8i_r40_tcon_tv_set_mux()
This commit attempts to fix a claimed reference leak in the success path of
sun8i_r40_tcon_tv_set_mux(). However, the patch modifies the wrong function
and introduces a build failure.
Fixes: 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON")
Cc: stable@vger.kernel.org
> drm/sun4i: Fix pdev reference leak in sun8i_r40_tcon_tv_set_mux()
>
> of_find_device_by_node() takes a reference to the TCON TOP device
> which the error paths release, but the success path returns without
> doing so. Drop the reference before returning success.
The commit message states it fixes a leak in sun8i_r40_tcon_tv_set_mux(),
but the patch actually modifies sun4i_tcon_init_clocks().
Looking at sun8i_r40_tcon_tv_set_mux() in the baseline, the success path
appears to fall through to the out_put_device label, which already correctly
drops the reference:
out_put_device:
put_device(&pdev->dev);
return ret;
Could the commit message be referencing an issue that does not exist in
this tree, or was the patch misapplied?
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index bf405a2aa3249..b5a85738876ee 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -808,6 +808,8 @@ static int sun4i_tcon_init_clocks(struct device *dev,
> }
> }
>
> + put_device(&pdev->dev);
[Severity: Low]
Does this code compile? The variable pdev is undeclared in the scope of
sun4i_tcon_init_clocks(), which causes a build failure.
> +
> return 0;
> }
Hi Wentao, kernel test robot noticed the following build errors: [auto build test ERROR on sunxi/sunxi/for-next] [also build test ERROR on daeinki-drm-exynos/exynos-drm-next drm/drm-next drm-i915/for-linux-next drm-i915/for-linux-next-fixes drm-misc/drm-misc-next drm-tip/drm-tip linus/master v7.3-rc3 next-20260916] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Wentao-Liang/drm-sun4i-Fix-pdev-reference-leak-in-sun8i_r40_tcon_tv_set_mux/20260916-182412 base: https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next patch link: https://lore.kernel.org/r/20260916182412.2091681-1-vulab%40iscas.ac.cn patch subject: [PATCH] drm/sun4i: Fix pdev reference leak in sun8i_r40_tcon_tv_set_mux() config: alpha-randconfig-r1306-20260917 (https://download.01.org/0day-ci/archive/20260917/202609172103.AfhCF3XZ-lkp@intel.com/config) compiler: alpha-linux-gcc (GCC) 15.2.0 sparse: v0.6.5-rc1 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260917/202609172103.AfhCF3XZ-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202609172103.AfhCF3XZ-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/gpu/drm/sun4i/sun4i_tcon.c: In function 'sun4i_tcon_init_clocks': >> drivers/gpu/drm/sun4i/sun4i_tcon.c:811:21: error: 'pdev' undeclared (first use in this function); did you mean 'dev'? 811 | put_device(&pdev->dev); | ^~~~ | dev drivers/gpu/drm/sun4i/sun4i_tcon.c:811:21: note: each undeclared identifier is reported only once for each function it appears in vim +811 drivers/gpu/drm/sun4i/sun4i_tcon.c 785 786 static int sun4i_tcon_init_clocks(struct device *dev, 787 struct sun4i_tcon *tcon) 788 { 789 tcon->clk = devm_clk_get_enabled(dev, "ahb"); 790 if (IS_ERR(tcon->clk)) { 791 dev_err(dev, "Couldn't get the TCON bus clock\n"); 792 return PTR_ERR(tcon->clk); 793 } 794 795 if (tcon->quirks->has_channel_0) { 796 tcon->sclk0 = devm_clk_get_enabled(dev, "tcon-ch0"); 797 if (IS_ERR(tcon->sclk0)) { 798 dev_err(dev, "Couldn't get the TCON channel 0 clock\n"); 799 return PTR_ERR(tcon->sclk0); 800 } 801 } 802 803 if (tcon->quirks->has_channel_1) { 804 tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); 805 if (IS_ERR(tcon->sclk1)) { 806 dev_err(dev, "Couldn't get the TCON channel 1 clock\n"); 807 return PTR_ERR(tcon->sclk1); 808 } 809 } 810 > 811 put_device(&pdev->dev); 812 813 return 0; 814 } 815 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Hi Wentao, kernel test robot noticed the following build errors: [auto build test ERROR on sunxi/sunxi/for-next] [also build test ERROR on daeinki-drm-exynos/exynos-drm-next drm/drm-next drm-i915/for-linux-next drm-i915/for-linux-next-fixes drm-misc/drm-misc-next drm-tip/drm-tip linus/master v7.3-rc3 next-20260916] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Wentao-Liang/drm-sun4i-Fix-pdev-reference-leak-in-sun8i_r40_tcon_tv_set_mux/20260916-182412 base: https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next patch link: https://lore.kernel.org/r/20260916182412.2091681-1-vulab%40iscas.ac.cn patch subject: [PATCH] drm/sun4i: Fix pdev reference leak in sun8i_r40_tcon_tv_set_mux() config: arm-defconfig (https://download.01.org/0day-ci/archive/20260918/202609180443.vTkwAZL6-lkp@intel.com/config) compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 7252edd9aa82ef1c570ff6694ef7f4763a8a5d2f) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260918/202609180443.vTkwAZL6-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202609180443.vTkwAZL6-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/gpu/drm/sun4i/sun4i_tcon.c:811:14: error: use of undeclared identifier 'pdev'; did you mean 'dev'? 811 | put_device(&pdev->dev); | ^~~~ | dev drivers/gpu/drm/sun4i/sun4i_tcon.c:786:50: note: 'dev' declared here 786 | static int sun4i_tcon_init_clocks(struct device *dev, | ^ >> drivers/gpu/drm/sun4i/sun4i_tcon.c:811:20: error: no member named 'dev' in 'struct device' 811 | put_device(&pdev->dev); | ~~~~ ^ 2 errors generated. vim +811 drivers/gpu/drm/sun4i/sun4i_tcon.c 785 786 static int sun4i_tcon_init_clocks(struct device *dev, 787 struct sun4i_tcon *tcon) 788 { 789 tcon->clk = devm_clk_get_enabled(dev, "ahb"); 790 if (IS_ERR(tcon->clk)) { 791 dev_err(dev, "Couldn't get the TCON bus clock\n"); 792 return PTR_ERR(tcon->clk); 793 } 794 795 if (tcon->quirks->has_channel_0) { 796 tcon->sclk0 = devm_clk_get_enabled(dev, "tcon-ch0"); 797 if (IS_ERR(tcon->sclk0)) { 798 dev_err(dev, "Couldn't get the TCON channel 0 clock\n"); 799 return PTR_ERR(tcon->sclk0); 800 } 801 } 802 803 if (tcon->quirks->has_channel_1) { 804 tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); 805 if (IS_ERR(tcon->sclk1)) { 806 dev_err(dev, "Couldn't get the TCON channel 1 clock\n"); 807 return PTR_ERR(tcon->sclk1); 808 } 809 } 810 > 811 put_device(&pdev->dev); 812 813 return 0; 814 } 815 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 960e83c8291d..07350361fc4b 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -1444,6 +1444,8 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon, } } + put_device(&pdev->dev); + return 0; }