diff mbox series

[v4,01/22] log: Fix missing negation of ENOMEM

Message ID 20201027235541.706077-2-seanga2@gmail.com
State Accepted
Commit 69529f9840f5de01a5865d2b55cd741713676956
Delegated to: Tom Rini
Headers show
Series log: Add commands for manipulating filters | expand

Commit Message

Sean Anderson Oct. 27, 2020, 11:55 p.m. UTC
Errors returned should be negative.

Fixes: 45fac9fc18 ("log: Correct missing free() on error in log_add_filter()")

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---

(no changes since v1)

 common/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Oct. 30, 2020, 6:46 p.m. UTC | #1
On Tue, Oct 27, 2020 at 07:55:20PM -0400, 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@gmail.com>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/log.c b/common/log.c
index b7a6ebe298..6aab189a46 100644
--- a/common/log.c
+++ b/common/log.c
@@ -278,7 +278,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;
 		}
 	}