[PATCH 01/18] log: Fix missing negation of ENOMEM

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Oct 6 22:36:49 CEST 2020


On 10/6/20 9:15 PM, Sean Anderson wrote:
> Errors returned should be negative.
>
> Fixes: 45fac9fc18 ("log: Correct missing free() on error in log_add_filter()")
>
> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
> ---
>
>  common/log.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/log.c b/common/log.c
> index 9a5f100da3..3f6f4bdc2a 100644
> --- a/common/log.c
> +++ b/common/log.c
> @@ -268,7 +268,7 @@ int log_add_filter(const char *drv_name, enum log_category_t cat_list[],
>  	if (file_list) {
>  		filt->file_list = strdup(file_list);
>  		if (!filt->file_list) {
> -			ret = ENOMEM;
> +			ret = -ENOMEM;
>  			goto err;
>  		}
>  	}
>

According to the function description for log_add_filter() in
include/log.h errors should be returned as negative numbers.

Reviewed-by: Heinrich Schuchardt <xypron.glpk at gmx.de>


More information about the U-Boot mailing list