diff mbox series

Fix coverity #332451

Message ID 20210625134240.1119244-1-stefano.babic@babic.homelinux.org
State Accepted
Headers show
Series Fix coverity #332451 | expand

Commit Message

Stefano Babic June 25, 2021, 1:42 p.m. UTC
From: Stefano Babic <sbabic@denx.de>

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 core/notifier.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/core/notifier.c b/core/notifier.c
index 1052dbd..810769c 100644
--- a/core/notifier.c
+++ b/core/notifier.c
@@ -199,6 +199,8 @@  int register_notifier(notifier client)
 		return -1;
 
 	newclient = (struct notify_elem *)calloc(1, sizeof(struct notify_elem));
+	if (!newclient)
+		return -ENOMEM;
 	newclient->client = client;
 
 	STAILQ_INSERT_TAIL(&clients, newclient, next);