Commit 6d1c32db authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Lee Jones
Browse files

backlight: lm3630a_bl: Put fwnode in error case during ->probe()



device_for_each_child_node() bumps a reference counting of a returned variable.
We have to balance it whenever we return to the caller.

Cc: Brian Masney <masneyb@onstation.org>
Cc: Dan Murphy <dmurphy@ti.com>
Fixes: 8fbce8ef ("backlight: lm3630a: Add firmware node support")
Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarBrian Masney <masneyb@onstation.org>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 6efb943b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -482,9 +482,11 @@ static int lm3630a_parse_node(struct lm3630a_chip *pchip,

	device_for_each_child_node(pchip->dev, node) {
		ret = lm3630a_parse_bank(pdata, node, &seen_led_sources);
		if (ret)
		if (ret) {
			fwnode_handle_put(node);
			return ret;
		}
	}

	return ret;
}