From: Dongwoo Lee Date: Fri, 12 Aug 2016 03:56:16 +0000 (+0900) Subject: power: max77843_charger: fix bugs for extcon register X-Git-Tag: accepted/tizen/common/20160816.130236~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d4c5a6ba253b9c93c3509254b6cd4326671a135;p=platform%2Fkernel%2Flinux-exynos.git power: max77843_charger: fix bugs for extcon register A member "edev" of struct "max77843_charger" is uninitalized, but is accessed in conditional statement. The code seems to have a bug. This patch fixes this bug. Change-Id: I103554ab8a5ddcfcae623cd5dc914aeaed6a48cb Signed-off-by: Dongwoo Lee --- diff --git a/drivers/power/max77843_charger.c b/drivers/power/max77843_charger.c index aade98d..d61907f 100644 --- a/drivers/power/max77843_charger.c +++ b/drivers/power/max77843_charger.c @@ -485,7 +485,7 @@ static int max77843_extcon_register(struct max77843_charger *charger) charger->otg_nb.notifier_call = max77843_charger_otg_notifier; edev = extcon_get_edev_by_phandle(charger->dev, 0); - if (IS_ERR(charger->edev)) { + if (IS_ERR(edev)) { dev_dbg(charger->dev, "Cannot get extcon device\n"); return -EPROBE_DEFER; }