From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
Mikko Perttunen <cyndis@kapsi.fi>,
Wolfram Sang <wsa@the-dreams.de>
Cc: linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 7/9] clk: tegra: Fix double-free in tegra_clk_init()
Date: Mon, 6 Jan 2020 04:04:21 +0300 [thread overview]
Message-ID: <20200106010423.5890-8-digetx@gmail.com> (raw)
In-Reply-To: <20200106010423.5890-1-digetx@gmail.com>
It's unlikely to happen in practice ever, but makes static checkers happy.
Fixes: 535f296d47de ("clk: tegra: Add suspend and resume support on Tegra210")
Reported-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
drivers/clk/tegra/clk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c
index e6bd6d1ea012..f6cdce441cf7 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -231,8 +231,10 @@ struct clk ** __init tegra_clk_init(void __iomem *regs, int num, int banks)
periph_banks = banks;
clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL);
- if (!clks)
+ if (!clks) {
kfree(periph_clk_enb_refcnt);
+ return NULL;
+ }
clk_num = num;
--
2.24.0
next prev parent reply other threads:[~2020-01-06 1:04 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-06 1:04 [PATCH v3 0/9] NVIDIA Tegra I2C driver fixes and improvements Dmitry Osipenko
2020-01-06 1:04 ` [PATCH v3 1/9] i2c: tegra: Fix suspending in active runtime PM state Dmitry Osipenko
2020-01-07 12:38 ` Thierry Reding
2020-01-07 12:38 ` Thierry Reding
2020-01-06 1:04 ` [PATCH v3 2/9] i2c: tegra: Properly disable runtime PM on driver's probe error Dmitry Osipenko
2020-01-07 12:38 ` Thierry Reding
2020-01-07 12:38 ` Thierry Reding
2020-01-06 1:04 ` [PATCH v3 3/9] i2c: tegra: Prevent interrupt triggering after transfer timeout Dmitry Osipenko
2020-01-07 12:39 ` Thierry Reding
2020-01-07 12:39 ` Thierry Reding
2020-01-06 1:04 ` [PATCH v3 4/9] i2c: tegra: Support atomic transfers Dmitry Osipenko
2020-01-07 12:39 ` Thierry Reding
2020-01-07 12:39 ` Thierry Reding
2020-01-06 1:04 ` [PATCH v3 5/9] i2c: tegra: Rename I2C_PIO_MODE_MAX_LEN to I2C_PIO_MODE_PREFERRED_LEN Dmitry Osipenko
2020-01-07 12:39 ` Thierry Reding
2020-01-07 12:39 ` Thierry Reding
2020-01-06 1:04 ` [PATCH v3 6/9] i2c: tegra: Use relaxed versions of readl/writel Dmitry Osipenko
2020-01-07 12:39 ` Thierry Reding
2020-01-07 12:39 ` Thierry Reding
2020-01-06 1:04 ` Dmitry Osipenko [this message]
2020-01-07 12:39 ` [PATCH v3 7/9] clk: tegra: Fix double-free in tegra_clk_init() Thierry Reding
2020-01-07 12:39 ` Thierry Reding
2020-01-06 1:04 ` [PATCH v3 8/9] i2c: tegra: Always terminate DMA transfer Dmitry Osipenko
2020-01-07 12:39 ` Thierry Reding
2020-01-07 12:39 ` Thierry Reding
2020-01-06 1:04 ` [PATCH v3 9/9] i2c: tegra: Check DMA completion status in addition to left time Dmitry Osipenko
2020-01-07 12:39 ` Thierry Reding
2020-01-07 12:39 ` Thierry Reding
2020-01-07 12:38 ` [PATCH v3 0/9] NVIDIA Tegra I2C driver fixes and improvements Thierry Reding
2020-01-07 16:39 ` Dmitry Osipenko
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=20200106010423.5890-8-digetx@gmail.com \
--to=digetx@gmail.com \
--cc=cyndis@kapsi.fi \
--cc=jonathanh@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=wsa@the-dreams.de \
/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 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.