All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Manning <cdhmanning@gmail.com>
To: linux-kernel@vger.kernel.org, s.trumtrar@pengutronix.de,
	dinguyen@altera.com, cslee@altera.com
Cc: Charles Manning <cdhmanning@gmail.com>
Subject: [PATCH 0/3] clk : Fix SOCFPGA clk crash and some clean up
Date: Tue, 22 Jul 2014 14:20:31 +1200	[thread overview]
Message-ID: <1405995634-3297-1-git-send-email-cdhmanning@gmail.com> (raw)

After some digging into a crash on the SOCFPGA initialisation it was
determined that this was due to the SOCFPGA's name look-up dereferencing
the clock init pointer. This is a bad thing to do because the init data is
constructed on the stack and thus a pointer to the init data is no longer
valid after clk_register() has been called.

Most, if not all, drivers create the init data on the stack. Thus init 
pointer should not be left hanging after it has been used in clk_register.
Thus one of these patches NULLs the pointer so it can't be abused.

In the long term, it would be way, way better to pass the init pointer as
an argument rather than as a pointer in hw.


Charles Manning (3):
  clk : Clean up checkpatch warnings
  clk: Prevent a hanging pointer being abused
  clk: socfpga Change name look-up to not use the init pointer

 drivers/clk/clk.c                | 37 +++++++++++++++++++--------------
 drivers/clk/socfpga/clk-gate.c   | 44 ++++++++++++++++++++++++++--------------
 drivers/clk/socfpga/clk-periph.c | 16 ++++++++++-----
 drivers/clk/socfpga/clk-pll.c    | 13 ++++++++----
 drivers/clk/socfpga/clk.h        |  7 ++++---
 5 files changed, 75 insertions(+), 42 deletions(-)

-- 
1.9.1


             reply	other threads:[~2014-07-22  2:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22  2:20 Charles Manning [this message]
2014-07-22  2:20 ` [PATCH 1/3] clk : Clean up checkpatch warnings Charles Manning
2014-07-30 12:19   ` Pavel Machek
2014-07-22  2:20 ` [PATCH 2/3] clk: Prevent a hanging pointer being abused Charles Manning
2014-07-30 12:20   ` Pavel Machek
2014-07-22  2:20 ` [PATCH 3/3] clk: socfpga Change name look-up to not use the init pointer Charles Manning
2014-07-22  6:00 ` [PATCH 0/3] clk : Fix SOCFPGA clk crash and some clean up Steffen Trumtrar
2014-07-22 15:34   ` Dinh Nguyen

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=1405995634-3297-1-git-send-email-cdhmanning@gmail.com \
    --to=cdhmanning@gmail.com \
    --cc=cslee@altera.com \
    --cc=dinguyen@altera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.trumtrar@pengutronix.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.