system-linux: check ioctl return value in system_vlan()
authorHans Dedecker <dedeckeh@gmail.com>
Mon, 16 Apr 2018 11:02:28 +0000 (13:02 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 16 Apr 2018 11:04:26 +0000 (13:04 +0200)
Detected by Coverity in CID 1433754

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
system-linux.c

index 0b594f67a55f80274b7009494a9843b113a4d843..9b654d16c2117d263cd325e7cff4a65d2744f380 100644 (file)
@@ -1250,7 +1250,8 @@ static int system_vlan(struct device *dev, int id)
                .u.name_type = VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD,
        };
 
-       ioctl(sock_ioctl, SIOCSIFVLAN, &ifr);
+       if (ioctl(sock_ioctl, SIOCSIFVLAN, &ifr) < 0)
+               return -1;
 
        if (id < 0) {
                ifr.cmd = DEL_VLAN_CMD;