<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/include/soc/starfive, branch v6.6.131</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>clk: starfive: Avoid casting iomem pointers</title>
<updated>2023-04-13T22:45:46+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2023-04-13T20:55:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=d1aae06630230daf747ef5bc291c19ea7f046129'/>
<id>d1aae06630230daf747ef5bc291c19ea7f046129</id>
<content type='text'>
Let's use a wrapper struct for the auxiliary_device made in
jh7110_reset_controller_register() so that we can stop casting iomem
pointers. The casts trip up tools like sparse, and make for some awkward
casts that are largely unnecessary. While we're here, change the
allocation from devm and actually free the auxiliary_device memory in
the release function. This avoids any use after free problems where the
parent device driver is unbound from the device but the
auxiliuary_device is still in use accessing devm freed memory.

Cc: Tommaso Merciai &lt;tomm.merciai@gmail.com&gt;
Cc: Emil Renner Berthing &lt;emil.renner.berthing@canonical.com&gt;
Cc: Hal Feng &lt;hal.feng@starfivetech.com&gt;
Cc: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Cc: Xingyu Wu &lt;xingyu.wu@starfivetech.com&gt;
Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Fixes: edab7204afe5 ("clk: starfive: Add StarFive JH7110 system clock driver")
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20230413205528.4044216-1-sboyd@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let's use a wrapper struct for the auxiliary_device made in
jh7110_reset_controller_register() so that we can stop casting iomem
pointers. The casts trip up tools like sparse, and make for some awkward
casts that are largely unnecessary. While we're here, change the
allocation from devm and actually free the auxiliary_device memory in
the release function. This avoids any use after free problems where the
parent device driver is unbound from the device but the
auxiliuary_device is still in use accessing devm freed memory.

Cc: Tommaso Merciai &lt;tomm.merciai@gmail.com&gt;
Cc: Emil Renner Berthing &lt;emil.renner.berthing@canonical.com&gt;
Cc: Hal Feng &lt;hal.feng@starfivetech.com&gt;
Cc: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Cc: Xingyu Wu &lt;xingyu.wu@starfivetech.com&gt;
Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Fixes: edab7204afe5 ("clk: starfive: Add StarFive JH7110 system clock driver")
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20230413205528.4044216-1-sboyd@kernel.org
</pre>
</div>
</content>
</entry>
</feed>
