memory: fsl_ifc: Do not dereference the unset global pointer in probe
Commit a78ee2e05f7c ("memory: fsl_ifc: Clear fsl_ifc_ctrl_dev on probe failure
and removal") assigns fsl_ifc_ctrl_dev near the end of probe, but probe still
reads the IFC revision and fsl_ifc_ctrl_init() still programs the event
registers before that. Both go through ifc_in32() and ifc_out32(), which take
the register endianness from fsl_ifc_ctrl_dev, so the first probe dereferences
a NULL pointer.
Use local accessors that take the endianness from the controller being probed
for these register accesses.
Fixes: a78ee2e05f7c ("memory: fsl_ifc: Clear fsl_ifc_ctrl_dev on probe failure and removal")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261109134708.263012-1-sashal@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
1 file changed