Skip to content
Snippets Groups Projects
Commit 895a82ce authored by Neil Armstrong's avatar Neil Armstrong Committed by Tom Rini
Browse files

reset: fix reset_get_bulk when phandle error


This fixes the Coverity Defect CID 175348 when dev_count_phandle_with_args()
returns a negative value.

Fixes: 0c282339 ("reset: Add get/assert/deassert/release for bulk of reset signals")
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
parent 34b3722e
No related branches found
No related tags found
No related merge requests found
...@@ -88,8 +88,8 @@ int reset_get_bulk(struct udevice *dev, struct reset_ctl_bulk *bulk) ...@@ -88,8 +88,8 @@ int reset_get_bulk(struct udevice *dev, struct reset_ctl_bulk *bulk)
bulk->count = 0; bulk->count = 0;
count = dev_count_phandle_with_args(dev, "resets", "#reset-cells"); count = dev_count_phandle_with_args(dev, "resets", "#reset-cells");
if (!count) if (count < 1)
return 0; return count;
bulk->resets = devm_kcalloc(dev, count, sizeof(struct reset_ctl), bulk->resets = devm_kcalloc(dev, count, sizeof(struct reset_ctl),
GFP_KERNEL); GFP_KERNEL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment