[PATCH 07/17] reset: Avoid a warning in devm_regmap_init()

Pratyush Yadav p.yadav at ti.com
Mon May 10 09:29:27 CEST 2021


> Subject: [PATCH 07/17] reset: Avoid a warning in devm_regmap_init()

s/reset/regmap/

On 08/05/21 04:00PM, Simon Glass wrote:
> 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 at chromium.org>
> Reported-by: Coverity (CID: 312951)

Acked-by: Pratyush Yadav <p.yadav at ti.com>

> ---
> 
>  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))

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.


More information about the U-Boot mailing list