diff options
author | Neil Armstrong <narmstrong@baylibre.com> | 2018-04-17 11:30:22 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-04-17 17:45:08 -0400 |
commit | 895a82ce90278130828b26c230da99331a33e729 (patch) | |
tree | fc4ba4ae48554e4f510461ba3fe0139fb8ee286f /drivers/reset | |
parent | 34b3722e381c0146b4aa7fea3a5243c588b8ed2f (diff) | |
download | u-boot-895a82ce90278130828b26c230da99331a33e729.tar.gz |
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: 0c28233903b5 ("reset: Add get/assert/deassert/release for bulk of reset signals")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'drivers/reset')
-rw-r--r-- | drivers/reset/reset-uclass.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c index 9a5c9c91b9..fa4f6538ed 100644 --- a/drivers/reset/reset-uclass.c +++ b/drivers/reset/reset-uclass.c @@ -88,8 +88,8 @@ int reset_get_bulk(struct udevice *dev, struct reset_ctl_bulk *bulk) bulk->count = 0; count = dev_count_phandle_with_args(dev, "resets", "#reset-cells"); - if (!count) - return 0; + if (count < 1) + return count; bulk->resets = devm_kcalloc(dev, count, sizeof(struct reset_ctl), GFP_KERNEL); |