Thread (5 messages) 5 messages, 2 authors, 2020-05-26

Re: [PATCH 1/2] clk: bcm2835: Fix return type of bcm2835_register_gate

From: Nathan Chancellor <hidden>
Date: 2020-05-26 23:53:14
Also in: linux-clk, lkml

On Tue, May 26, 2020 at 04:42:04PM -0700, Stephen Boyd wrote:
Quoting Nathan Chancellor (2020-05-16 01:08:06)
quoted
bcm2835_register_gate is used as a callback for the clk_register member
of bcm2835_clk_desc, which expects a struct clk_hw * return type but
bcm2835_register_gate returns a struct clk *.

This discrepancy is hidden by the fact that bcm2835_register_gate is
cast to the typedef bcm2835_clk_register by the _REGISTER macro. This
turns out to be a control flow integrity violation, which is how this
was noticed.

Change the return type of bcm2835_register_gate to be struct clk_hw *
and use clk_hw_register_gate to do so. This should be a non-functional
change as clk_register_gate calls clk_hw_register_gate anyways but this
is needed to avoid issues with further changes.

Fixes: b19f009d4510 ("clk: bcm2835: Migrate to clk_hw based registration and OF APIs")
Link: https://github.com/ClangBuiltLinux/linux/issues/1028
Signed-off-by: Nathan Chancellor <redacted>
---
Thanks. Applied to clk-next.
quoted
base-commit: bdecf38f228bcca73b31ada98b5b7ba1215eb9c9
Please don't base on some random linux-next commit though.
Sorry, should have just used clk-next directly instead of the HEAD of
linux-next at the time. Just hard to keep track of all of the different
maintainer trees so it is easier to just use linux-next.

I do forget to use the output of --scm from
get_maintainer.pl though, I should use that more often.

Thank you for picking it up!

Nathan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help