[PATCH 0/3] clk : Fix SOCFPGA clk crash and some clean up

From: Charles Manning
Date: Mon Jul 21 2014 - 22:20:58 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/