From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: return proper ERR_PTR for clk_get when !HAVE_CLK
Date: Thu, 5 Feb 2015 23:40:40 +0000 [thread overview]
Message-ID: <20150205234040.GV8656@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1423163365-15267-1-git-send-email-wsa@the-dreams.de>
On Thu, Feb 05, 2015 at 08:09:22PM +0100, Wolfram Sang wrote:
> clk_get functions return an ERR_PTR and not NULL in the error case. Make
> that consistent for the dummy functions when HAVE_CLK is not enabled.
> Otherwise unexpected codepaths might be trying to use a NULL pointer.
NAK.
There are some drivers which rely on this behaviour (take a driver,
such as some PXA IP) which uses the clk API but is also reused on
x86 which doesn't.
Remember, for any clk API implementation, it is well defined that
the clk API should safely eat any struct clk that clk_get() may
return which isn't a pointer-error.
So, if an implementation returns the NULL pointer, then the clk API
functions must accept it without crashing the kernel.
Also, clock consumer drivers are _not_ allowed to dereference
struct clk. Absolutely not permitted.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2015-02-05 23:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-05 19:09 [PATCH] clk: return proper ERR_PTR for clk_get when !HAVE_CLK Wolfram Sang
2015-02-05 23:40 ` Russell King - ARM Linux [this message]
2015-02-07 16:42 ` Wolfram Sang
2015-02-07 17:29 ` Russell King - ARM Linux
2015-02-09 14:29 ` Wolfram Sang
2015-02-10 11:02 ` Russell King - ARM Linux
2015-02-19 16:20 ` Wolfram Sang
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=20150205234040.GV8656@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox