All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Mike Turquette <mturquette@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>, <linux-omap@vger.kernel.org>,
	<linux-clk@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFT PATCH 0/8] clk: ti: Fix possible ERR_PTR dereferences from clk_get_sys
Date: Wed, 13 May 2015 10:07:08 +0300	[thread overview]
Message-ID: <5552F81C.2010301@ti.com> (raw)
In-Reply-To: <1431500087-2275-1-git-send-email-k.kozlowski@samsung.com>

On 05/13/2015 09:54 AM, Krzysztof Kozlowski wrote:
> Hi,
>
>
> clk_get_sys() may return ERR_PTR but the drivers immediately
> dereferenced the return value. This could lead to oops.
>
> I tried only to fix possible ERR_PTR dereference and to not change
> the logic. This is why some of the patches look quite complex.
> For example in clk-7xx driver proceeds to next clocks if first one fails.
>
> WARNING:
> The patchset was only compile tested (plus static checkers), as
> I do not have the hardware. I am kindly asking for tests.
>
>
> Best regards,
> Krzysztof

Hi Krzysztof,

These should be rather fixed by using assigned-clock-parents / 
assigned-clock-rates DT properties and removing the offending legacy 
code from clk-* files. Patch #1 is good to go as is.

-Tero

>
>
> Krzysztof Kozlowski (8):
>    clk: ti: dra7-atl-clock: Fix possible ERR_PTR dereference
>    clk: ti: clk-2xxx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-3xxx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-33xx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-43xx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-43xx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-54xx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-7xx: Prevent possible ERR_PTR dereference
>
>   drivers/clk/ti/clk-2xxx.c     | 18 ++++++++++++----
>   drivers/clk/ti/clk-33xx.c     |  9 +++++---
>   drivers/clk/ti/clk-3xxx.c     | 18 ++++++++++++----
>   drivers/clk/ti/clk-43xx.c     |  3 ++-
>   drivers/clk/ti/clk-44xx.c     | 16 ++++++++++----
>   drivers/clk/ti/clk-54xx.c     | 47 +++++++++++++++++++++++++++-------------
>   drivers/clk/ti/clk-7xx.c      | 50 +++++++++++++++++++++++++------------------
>   drivers/clk/ti/clk-dra7-atl.c |  5 +++++
>   8 files changed, 114 insertions(+), 52 deletions(-)
>

WARNING: multiple messages have this Message-ID (diff)
From: Tero Kristo <t-kristo@ti.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Mike Turquette <mturquette@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	linux-omap@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFT PATCH 0/8] clk: ti: Fix possible ERR_PTR dereferences from clk_get_sys
Date: Wed, 13 May 2015 10:07:08 +0300	[thread overview]
Message-ID: <5552F81C.2010301@ti.com> (raw)
In-Reply-To: <1431500087-2275-1-git-send-email-k.kozlowski@samsung.com>

On 05/13/2015 09:54 AM, Krzysztof Kozlowski wrote:
> Hi,
>
>
> clk_get_sys() may return ERR_PTR but the drivers immediately
> dereferenced the return value. This could lead to oops.
>
> I tried only to fix possible ERR_PTR dereference and to not change
> the logic. This is why some of the patches look quite complex.
> For example in clk-7xx driver proceeds to next clocks if first one fails.
>
> WARNING:
> The patchset was only compile tested (plus static checkers), as
> I do not have the hardware. I am kindly asking for tests.
>
>
> Best regards,
> Krzysztof

Hi Krzysztof,

These should be rather fixed by using assigned-clock-parents / 
assigned-clock-rates DT properties and removing the offending legacy 
code from clk-* files. Patch #1 is good to go as is.

-Tero

>
>
> Krzysztof Kozlowski (8):
>    clk: ti: dra7-atl-clock: Fix possible ERR_PTR dereference
>    clk: ti: clk-2xxx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-3xxx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-33xx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-43xx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-43xx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-54xx: Prevent possible ERR_PTR dereference
>    clk: ti: clk-7xx: Prevent possible ERR_PTR dereference
>
>   drivers/clk/ti/clk-2xxx.c     | 18 ++++++++++++----
>   drivers/clk/ti/clk-33xx.c     |  9 +++++---
>   drivers/clk/ti/clk-3xxx.c     | 18 ++++++++++++----
>   drivers/clk/ti/clk-43xx.c     |  3 ++-
>   drivers/clk/ti/clk-44xx.c     | 16 ++++++++++----
>   drivers/clk/ti/clk-54xx.c     | 47 +++++++++++++++++++++++++++-------------
>   drivers/clk/ti/clk-7xx.c      | 50 +++++++++++++++++++++++++------------------
>   drivers/clk/ti/clk-dra7-atl.c |  5 +++++
>   8 files changed, 114 insertions(+), 52 deletions(-)
>


  parent reply	other threads:[~2015-05-13  7:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  6:54 [RFT PATCH 0/8] clk: ti: Fix possible ERR_PTR dereferences from clk_get_sys Krzysztof Kozlowski
2015-05-13  6:54 ` [RFT PATCH 1/8] clk: ti: dra7-atl-clock: Fix possible ERR_PTR dereference Krzysztof Kozlowski
2015-05-14 22:31   ` Stephen Boyd
2015-05-13  6:54 ` [RFT PATCH 2/8] clk: ti: clk-2xxx: Prevent " Krzysztof Kozlowski
2015-05-13  6:54 ` [RFT PATCH 3/8] clk: ti: clk-3xxx: " Krzysztof Kozlowski
2015-05-13  6:54 ` [RFT PATCH 4/8] clk: ti: clk-33xx: " Krzysztof Kozlowski
2015-05-13  6:54 ` [RFT PATCH 5/8] clk: ti: clk-43xx: " Krzysztof Kozlowski
2015-05-13  6:54 ` [RFT PATCH 6/8] " Krzysztof Kozlowski
2015-05-13  6:54 ` [RFT PATCH 7/8] clk: ti: clk-54xx: " Krzysztof Kozlowski
2015-05-13  6:54 ` [RFT PATCH 8/8] clk: ti: clk-7xx: " Krzysztof Kozlowski
2015-05-13  7:07 ` Tero Kristo [this message]
2015-05-13  7:07   ` [RFT PATCH 0/8] clk: ti: Fix possible ERR_PTR dereferences from clk_get_sys Tero Kristo

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=5552F81C.2010301@ti.com \
    --to=t-kristo@ti.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=sboyd@codeaurora.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 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.