leds: flash: leds-qcom-flash: Put child node if registration failed

Put the child node if register flash LED device failed.

Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Link: https://lore.kernel.org/r/20230725-leds-qcom-flash-driver-tiny-fixes-v2-3-0f5cbce5fed0@quicinc.com
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
Fenglin Wu 2023-07-25 17:57:21 +08:00 committed by Lee Jones
parent 7c47381c86
commit 546924102d

View file

@ -749,6 +749,7 @@ static int qcom_flash_led_probe(struct platform_device *pdev)
return 0;
release:
fwnode_handle_put(child);
while (flash_data->v4l2_flash[flash_data->leds_count] && flash_data->leds_count)
v4l2_flash_release(flash_data->v4l2_flash[flash_data->leds_count--]);
return rc;