
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 molify Coverity.
Signed-off-by: Simon Glass sjg@chromium.org Reported-by: Coverity (CID: 312951) ---
drivers/core/regmap.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c index b51ce108c14..15ed189352c 100644 --- a/drivers/core/regmap.c +++ b/drivers/core/regmap.c @@ -293,6 +293,7 @@ struct regmap *devm_regmap_init(struct udevice *dev, int rc; struct regmap **mapp, *map;
+ /* coverity[RESOURCE_LEAK] */ mapp = devres_alloc(devm_regmap_release, sizeof(struct regmap *), __GFP_ZERO); if (unlikely(!mapp))