OSDN Git Service

regulator: fixed: Prevent NULL pointer dereference when !CONFIG_OF
authorAxel Lin <axel.lin@ingics.com>
Sun, 22 Sep 2019 02:29:28 +0000 (10:29 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 23 Sep 2019 21:19:52 +0000 (14:19 -0700)
commit1d6db22ff7d67a17c571543c69c63b1d261249b0
tree2980466b7cf3222c8bdaca109f4e43983b923e17
parentf8970d341eec73c976a3462b9ecdb02b60b84dd6
regulator: fixed: Prevent NULL pointer dereference when !CONFIG_OF

Use of_device_get_match_data which has NULL test for match before
dereference match->data. Add NULL test for drvtype so it still works
for fixed_voltage_ops when !CONFIG_OF.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Philippe Schenker <philippe.schenker@toradex.com>
Link: https://lore.kernel.org/r/20190922022928.28355-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/fixed.c