]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: imx: Fix boot crash if ocotp is not found
authorLeonard Crestez <leonard.crestez@nxp.com>
Tue, 10 Dec 2019 21:49:28 +0000 (23:49 +0200)
committerShawn Guo <shawnguo@kernel.org>
Thu, 12 Dec 2019 02:44:28 +0000 (10:44 +0800)
commit9dd8c8895d08cb6eca858a5648682dbcda466cb8
tree2433462645871c395bf399bfc0359f9e0f43c014
parentc257fbe756568d8f3012b228f6c3c9131d1eb492
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: 9568e7ed2c92 ("ARM: imx: Add serial number support for i.MX6/7 SoCs")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Tested-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/mach-imx/cpu.c