All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] clk : Fix SOCFPGA clk crash and some clean up
@ 2014-07-22  2:20 Charles Manning
  2014-07-22  2:20 ` [PATCH 1/3] clk : Clean up checkpatch warnings Charles Manning
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Charles Manning @ 2014-07-22  2:20 UTC (permalink / raw)
  To: linux-kernel, s.trumtrar, dinguyen, cslee; +Cc: Charles Manning

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-30 12:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22  2:20 [PATCH 0/3] clk : Fix SOCFPGA clk crash and some clean up Charles Manning
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

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.