From: Hans Dedecker Date: Mon, 16 Apr 2018 11:02:28 +0000 (+0200) Subject: system-linux: check ioctl return value in system_vlan() X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=513eb27dae4e42277f91bf746b3c3dcb9d633ead system-linux: check ioctl return value in system_vlan() Detected by Coverity in CID 1433754 Signed-off-by: Hans Dedecker --- diff --git a/system-linux.c b/system-linux.c index 0b594f6..9b654d1 100644 --- a/system-linux.c +++ b/system-linux.c @@ -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;