system-linux: check for open failure
authorGünther Kelleter <guenther.kelleter@devolo.de>
Thu, 3 Nov 2016 12:40:53 +0000 (13:40 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 4 Nov 2016 12:24:02 +0000 (13:24 +0100)
Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
system-linux.c

index 6e4a1949a11874443e05d45ebf41e916fcf23219..a0389879c4d47c7a8ec8769b362aeb2cd1acb07f 100644 (file)
@@ -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);