From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Zumeng Chen <zumeng.chen@gmail.com>,
Lee Jones <lee.jones@linaro.org>,
Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL 4.14 75/89] mfd: ti_am335x_tscadc: Fix struct clk memory leak
Date: Sun, 2 Sep 2018 13:07:41 +0000 [thread overview]
Message-ID: <20180902064918.183387-75-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180902064918.183387-1-alexander.levin@microsoft.com>
From: Zumeng Chen <zumeng.chen@gmail.com>
[ Upstream commit c2b1509c77a99a0dcea0a9051ca743cb88385f50 ]
Use devm_elk_get() to let Linux manage struct clk memory to avoid the following
memory leakage report:
unreferenced object 0xdd75efc0 (size 64):
comm "systemd-udevd", pid 186, jiffies 4294945126 (age 1195.750s)
hex dump (first 32 bytes):
61 64 63 5f 74 73 63 5f 66 63 6b 00 00 00 00 00 adc_tsc_fck.....
00 00 00 00 92 03 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<c0a15260>] kmemleak_alloc+0x40/0x74
[<c0287a10>] __kmalloc_track_caller+0x198/0x388
[<c0255610>] kstrdup+0x40/0x5c
[<c025565c>] kstrdup_const+0x30/0x3c
[<c0636630>] __clk_create_clk+0x60/0xac
[<c0630918>] clk_get_sys+0x74/0x144
[<c0630cdc>] clk_get+0x5c/0x68
[<bf0ac540>] ti_tscadc_probe+0x260/0x468 [ti_am335x_tscadc]
[<c06f3c0c>] platform_drv_probe+0x60/0xac
[<c06f1abc>] driver_probe_device+0x214/0x2dc
[<c06f1c18>] __driver_attach+0x94/0xc0
[<c06efe2c>] bus_for_each_dev+0x90/0xa0
[<c06f1470>] driver_attach+0x28/0x30
[<c06f1030>] bus_add_driver+0x184/0x1ec
[<c06f2b74>] driver_register+0xb0/0xf0
[<c06f3b4c>] __platform_driver_register+0x40/0x54
Signed-off-by: Zumeng Chen <zumeng.chen@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
drivers/mfd/ti_am335x_tscadc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index 0f3fab47fe48..7dc1cbcd2fb8 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -210,14 +210,13 @@ static int ti_tscadc_probe(struct platform_device *pdev)
* The TSC_ADC_SS controller design assumes the OCP clock is
* at least 6x faster than the ADC clock.
*/
- clk = clk_get(&pdev->dev, "adc_tsc_fck");
+ clk = devm_clk_get(&pdev->dev, "adc_tsc_fck");
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "failed to get TSC fck\n");
err = PTR_ERR(clk);
goto err_disable_clk;
}
clock_rate = clk_get_rate(clk);
- clk_put(clk);
tscadc->clk_div = clock_rate / ADC_CLK;
/* TSCADC_CLKDIV needs to be configured to the value minus 1 */
--
2.17.1
next prev parent reply other threads:[~2018-09-02 13:08 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-02 13:06 [PATCH AUTOSEL 4.14 01/89] misc: mic: SCIF Fix scif_get_new_port() error handling Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 02/89] ALSA: hda/realtek - Add mute LED quirk for HP Spectre x360 Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 03/89] ethtool: Remove trailing semicolon for static inline Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 04/89] i2c: aspeed: Add an explicit type casting for *get_clk_reg_val Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 05/89] Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 06/89] gpio: tegra: Move driver registration to subsys_init level Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 07/89] powerpc/powernv: Fix concurrency issue with npu->mmio_atsd_usage Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 08/89] selftests/bpf: fix a typo in map in map test Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 09/89] media: davinci: vpif_display: Mix memory leak on probe error path Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 10/89] media: dw2102: Fix memleak on sequence of probes Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 11/89] net: phy: Fix the register offsets in Broadcom iProc mdio mux driver Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 12/89] scsi: qla2xxx: Fix unintended Logout Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 13/89] blk-mq: fix updating tags depth Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 14/89] scsi: target: fix __transport_register_session locking Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 15/89] media: usbtv: use irqsave() in USB's complete callback Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 16/89] md/raid5: fix data corruption of replacements after originals dropped Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 17/89] timers: Clear timer_base::must_forward_clk with timer_base::lock held Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 18/89] media: camss: csid: Configure data type and decode format properly Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 19/89] gpu: ipu-v3: default to id 0 on missing OF alias Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 20/89] misc: ti-st: Fix memory leak in the error path of probe() Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 21/89] uio: potential double frees if __uio_register_device() fails Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 22/89] firmware: vpd: Fix section enabled flag on vpd_section_destroy Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 23/89] Drivers: hv: vmbus: Cleanup synic memory free path Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 24/89] tty: rocket: Fix possible buffer overwrite on register_PCI Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 25/89] f2fs: fix to active page in lru list for read path Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 26/89] ftrace: Add missing check for existing hwlat thread Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 27/89] f2fs: do not set free of current section Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 28/89] f2fs: fix defined but not used build warnings Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 29/89] perf tools: Allow overriding MAX_NR_CPUS at compile time Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 30/89] NFSv4.0 fix client reference leak in callback Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 31/89] perf c2c report: Fix crash for empty browser Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 32/89] fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 33/89] perf evlist: Fix error out while applying initial delay and LBR Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 34/89] macintosh/via-pmu: Add missing mmio accessors Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 35/89] ath9k: report tx status on EOSP Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 36/89] ath9k_hw: fix channel maximum power level test Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 37/89] ath10k: prevent active scans on potential unusable channels Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 38/89] wlcore: Set rx_status boottime_ns field on rx Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 39/89] rpmsg: core: add support to power domains for devices Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 40/89] MIPS: Fix ISA virt/bus conversion for non-zero PHYS_OFFSET Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 41/89] ata: libahci: Allow reconfigure of DEVSLP register Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 42/89] ata: libahci: Correct setting " Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 43/89] scsi: 3ware: fix return 0 on the error path of probe Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 44/89] tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 45/89] ath10k: disable bundle mgmt tx completion event support Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 46/89] Bluetooth: hidp: Fix handling of strncpy for hid->name information Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 47/89] x86/mm: Remove in_nmi() warning from vmalloc_fault() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 48/89] x86/kexec: Allocate 8k PGDs for PTI Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 49/89] ARM: 8783/1: NOMMU: Extend check for VBAR support Sasha Levin
2018-09-10 9:42 ` Vladimir Murzin
2018-09-10 14:12 ` Sasha Levin
2018-09-12 17:31 ` Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 50/89] pinctrl: imx: off by one in imx_pinconf_group_dbg_show() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 51/89] gpio: ml-ioh: Fix buffer underwrite on probe error path Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 52/89] pinctrl/amd: only handle irq if it is pending and unmasked Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 53/89] net: mvneta: fix mtu change on port without link Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 54/89] f2fs: try grabbing node page lock aggressively in sync scenario Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 55/89] pktcdvd: Fix possible Spectre-v1 for pkt_devs Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 56/89] f2fs: fix to skip GC if type in SSA and SIT is inconsistent Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 57/89] tpm_tis_spi: Pass the SPI IRQ down to the driver Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 58/89] tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 59/89] f2fs: fix to do sanity check with reserved blkaddr of inline inode Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 60/89] MIPS: Octeon: add missing of_node_put() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 61/89] MIPS: generic: fix " Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 62/89] iio: ad9523: Fix return value for ad952x_store() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 63/89] net: dcb: For wild-card lookups, use priority -1, not 0 Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 64/89] dm cache: only allow a single io_mode cache feature to be requested Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 65/89] Input: atmel_mxt_ts - only use first T9 instance Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 66/89] iommu/dma: Respect bus DMA limit for IOVAs Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 67/89] media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 68/89] partitions/aix: append null character to print data from disk Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 69/89] partitions/aix: fix usage of uninitialized lv_info and lvname structures Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 70/89] media: helene: fix xtal frequency setting at power on Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 71/89] f2fs: fix to wait on page writeback before updating page Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 72/89] f2fs: Fix uninitialized return in f2fs_ioc_shutdown() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 73/89] media: em28xx: Fix DualHD disconnect oops Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 74/89] iommu/ipmmu-vmsa: Fix allocation in atomic context Sasha Levin
2018-09-02 13:07 ` Sasha Levin [this message]
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 76/89] f2fs: fix to do sanity check with {sit,nat}_ver_bitmap_bytesize Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 77/89] ALSA: riptide: Properly endian notations Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 78/89] ALSA: pcm: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 79/89] ALSA: wss: " Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 80/89] ALSA: sb: Fix PCM format bit calculation Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 81/89] ALSA: asihpi: Fix PCM format notations Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 82/89] ALSA: ad1816a: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 83/89] ALSA: hda: Fix implicit PCM format type conversion Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 84/89] ALSA: au88x0: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 85/89] ALSA: sb: " Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 86/89] NFSv4.1: Fix a potential layoutget/layoutrecall deadlock Sasha Levin
2018-09-02 13:08 ` [PATCH AUTOSEL 4.14 87/89] MIPS: WARN_ON invalid DMA cache maintenance, not BUG_ON Sasha Levin
2018-09-02 13:08 ` [PATCH AUTOSEL 4.14 88/89] RDMA/cma: Do not ignore net namespace for unbound cm_id Sasha Levin
2018-09-02 13:08 ` [PATCH AUTOSEL 4.14 89/89] fuse: Add missed unlock_page() to fuse_readpages_fill() Sasha Levin
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=20180902064918.183387-75-alexander.levin@microsoft.com \
--to=alexander.levin@microsoft.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=zumeng.chen@gmail.com \
/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
Powered by JetHome