diff mbox series

[1/2] Fix coverity #292113

Message ID 20210705115317.127426-1-stefano.babic@babic.homelinux.org
State Accepted
Headers show
Series [1/2] Fix coverity #292113 | expand

Commit Message

Stefano Babic July 5, 2021, 11:53 a.m. UTC
From: Stefano Babic <sbabic@denx.de>

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

Patch

diff --git a/core/stream_interface.c b/core/stream_interface.c
index e87fc71..efa9cbd 100644
--- a/core/stream_interface.c
+++ b/core/stream_interface.c
@@ -570,6 +570,10 @@  void *network_initializer(void *data)
 			if (!(inst.fd < 0))
 				close(inst.fd);
 			inst.fd = open(software->output, O_RDONLY,  S_IRUSR);
+			if (inst.fd < 0) {
+				ERROR("%s cannot be opened", software->output);
+				ret = -ENODEV;
+			}
 		}
 
 		if (!ret) {