Skip to content
Commit 7947e323 authored by Leonard Crestez's avatar Leonard Crestez Committed by Shawn Guo
Browse files

ARM: imx: Fix boot crash if ocotp is not found

The imx_soc_device_init functions tries to fetch the ocotp regmap in
order to soc serial number. If regmap fetch fails then a message is
printed but regmap_read is called anyway and the system crashes.

Failing to lookup ocotp regmap shouldn't be a fatal boot error so check
that the pointer is valid.

Only side-effect of ocotp lookup failure now is that serial number will
be reported as all-zeros which is acceptable.

Cc: stable@vger.kernel.org
Fixes: 8267ff89

 ("ARM: imx: Add serial number support for i.MX6/7 SoCs")
Signed-off-by: default avatarLeonard Crestez <leonard.crestez@nxp.com>
Tested-by: default avatarChristoph Niedermaier <cniedermaier@dh-electronics.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 46db63ab
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment