Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: sky81452-backlight: Fix refcount imbalance on error

When of_property_read_u32_array() returns an error code, a
pairing refcount decrement is needed to keep np's refcount
balanced.

Fixes: f705806c9f355 ("backlight: Add support Skyworks SKY81452 backlight driver")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

dinghao.liu@zju.edu.cn and committed by
Lee Jones
b7a4f80b 9123e3a7

+1
+1
drivers/video/backlight/sky81452-backlight.c
··· 217 217 num_entry); 218 218 if (ret < 0) { 219 219 dev_err(dev, "led-sources node is invalid.\n"); 220 + of_node_put(np); 220 221 return ERR_PTR(-EINVAL); 221 222 } 222 223