From: Michael Tretter <m.tretter@pengutronix.de>
To: Colin King <colin.king@canonical.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Michal Simek <michal.simek@xilinx.com>,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next][V2] soc: xilinx: vcu: fix error check on clk_hw_get_parent call
Date: Thu, 11 Feb 2021 12:30:21 +0100 [thread overview]
Message-ID: <20210211113021.GE30300@pengutronix.de> (raw)
In-Reply-To: <20210211095700.158960-1-colin.king@canonical.com>
On Thu, 11 Feb 2021 09:57:00 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently the check for failur on the call to clk_hw_get_parent
> is checking for a null return in the divider pointer instead of
> checking the mux pointer. Fix this.
>
> Thanks to Michael Tretter for suggesting the correct fix.
Thanks!
>
> Addresses-Coverity: ("Logically Dead Code")
> Fixes: 9c789deea206 ("soc: xilinx: vcu: implement clock provider for output clocks")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>
> V2: Check on mux pointer rather than removing deadcode that wasn't
> actually really dead code.
>
> ---
> drivers/clk/xilinx/xlnx_vcu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c
> index d66b1315114e..256b8c4b9ee4 100644
> --- a/drivers/clk/xilinx/xlnx_vcu.c
> +++ b/drivers/clk/xilinx/xlnx_vcu.c
> @@ -512,7 +512,7 @@ static void xvcu_clk_hw_unregister_leaf(struct clk_hw *hw)
>
> mux = clk_hw_get_parent(divider);
> clk_hw_unregister_mux(mux);
The mux should be unregistered after the check
> - if (!divider)
> + if (!mux)
> return;
>
> clk_hw_unregister_divider(divider);
and the divider before the check.
Michael
prev parent reply other threads:[~2021-02-11 11:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 9:57 Colin King
2021-02-11 11:30 ` Michael Tretter [this message]
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=20210211113021.GE30300@pengutronix.de \
--to=m.tretter@pengutronix.de \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@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
all inboxes | Powered by JetHome®