[LEDE-DEV] [PATCH netifd] system-linux: check for open failure

Günther Kelleter guenther.kelleter at devolo.de
Thu Nov 3 05:40:53 PDT 2016


Signed-off-by: Günther Kelleter <guenther.kelleter at devolo.de>
---
 system-linux.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/system-linux.c b/system-linux.c
index 6e4a194..a038987 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -2489,6 +2489,8 @@ int system_update_ipv6_mtu(struct device *dev, int mtu)
 			dev->ifname);
 
 	int fd = open(buf, O_RDWR);
+	if (fd < 0)
+		return ret;
 
 	if (!mtu) {
 		ssize_t len = read(fd, buf, sizeof(buf) - 1);
-- 
2.10.0.100.gddd73ec




More information about the Lede-dev mailing list