regulator: qcom_smd: add NULL check on of_match_device() return value
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Fri, 7 Jul 2017 05:36:10 +0000 (00:36 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 7 Jul 2017 12:42:07 +0000 (13:42 +0100)
commite3b53b8a465133ce57f9722aab5617b8e0f9657f
tree7ca9388b45bbaf11f0313dc16ee28120c524888f
parent2f2472baa66ef9a6aa25124cb07679bbe613ceff
regulator: qcom_smd: add NULL check on of_match_device() return value

Check return value from call to of_match_device()
in order to prevent a NULL pointer dereference.

In case of NULL print error message and return.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/qcom_smd-regulator.c