diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2016-03-08 22:06:39 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-03-12 04:53:17 +0300 |
commit | 9979c1c70724ccca8fec10012e320b8145ad5368 (patch) | |
tree | 1f07e08cf00a22917b8d7c3197f7ef8771c4965c /drivers/input/keyboard | |
parent | 62d5bdf972ebcfc99f72f734ae979713e4ca6450 (diff) | |
download | linux-9979c1c70724ccca8fec10012e320b8145ad5368.tar.xz |
Input: snvs_pwrkey - fix returned value check of syscon_regmap_lookup_by_phandle()
On error syscon_regmap_lookup_by_phandle() returns ERR_PTR() value,
which makes a check for NULL invalid and may lead to oops on error
path.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/snvs_pwrkey.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c index b0ffadeb208c..24a9f599082f 100644 --- a/drivers/input/keyboard/snvs_pwrkey.c +++ b/drivers/input/keyboard/snvs_pwrkey.c @@ -111,9 +111,9 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) return -ENOMEM; pdata->snvs = syscon_regmap_lookup_by_phandle(np, "regmap"); - if (!pdata->snvs) { + if (IS_ERR(pdata->snvs)) { dev_err(&pdev->dev, "Can't get snvs syscon\n"); - return -ENODEV; + return PTR_ERR(pdata->snvs); } if (of_property_read_u32(np, "linux,keycode", &pdata->keycode)) { |