]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/network.c
network: fix lxc_netdev_rename_by_index()
[mirror_lxc.git] / src / lxc / network.c
index 189d92088fa53988dcfb20ccd37c0fc540ed07ef..0a78adc2088e024feec1fbcc190f5815ddcf61a8 100644 (file)
@@ -1160,8 +1160,10 @@ int lxc_netdev_rename_by_index(int ifindex, const char *newname)
                return err;
 
        len = strlen(newname);
-       if (len == 1 || len >= IFNAMSIZ)
+       if (len == 1 || len >= IFNAMSIZ) {
+               err = -EINVAL;
                goto out;
+       }
 
        err = -ENOMEM;
        nlmsg = nlmsg_alloc(NLMSG_GOOD_SIZE);