diff options
author | Simon Glass | 2021-05-13 19:39:21 -0600 |
---|---|---|
committer | Tom Rini | 2021-07-15 18:42:05 -0400 |
commit | ca4c24509c60cfc95563d25b482cfed3789aca59 (patch) | |
tree | c6a2b71c9925db3affb41a84b63facb917c3d538 /drivers | |
parent | 7f0f4e1825d1cbc64f6f8cba17f6deb7282acb2b (diff) |
reset: Avoid a warning in devm_reset_bulk_get_by_node()
The devres_alloc() function is intended to avoid the need for freeing
memory, although in practice it may not be enabled, thus leading to a true
leak.
Nevertheless this is intended. Add a comment to explain this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 312952)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/reset/reset-uclass.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c index 8caa616ed9f..c09c009130d 100644 --- a/drivers/reset/reset-uclass.c +++ b/drivers/reset/reset-uclass.c @@ -325,6 +325,8 @@ struct reset_ctl_bulk *devm_reset_bulk_get_by_node(struct udevice *dev, bulk = devres_alloc(devm_reset_bulk_release, sizeof(struct reset_ctl_bulk), __GFP_ZERO); + + /* this looks like a leak, but devres takes care of it */ if (unlikely(!bulk)) return ERR_PTR(-ENOMEM); |