if (!bp->present)
return 0;
- ret = bonding_set_active(bdev, true);
- if (ret)
- goto error;
-
/* Disable IPv6 for bonding ports */
if (!(bp->dev.dev->settings.flags & DEV_OPT_IPV6)) {
bp->dev.dev->settings.ipv6 = 0;
ret = device_claim(&bp->dev);
if (ret < 0)
- goto error;
+ return ret;
+
+ ret = bonding_set_active(bdev, true);
+ if (ret)
+ goto release;
dev = bp->dev.dev;
if (dev->settings.auth && !dev->auth_status)
bdev->n_failed++;
bp->present = false;
bdev->n_present--;
+release:
device_release(&bp->dev);
return ret;
{
struct bonding_device *bdev;
struct blob_attr *cur;
- int rem;
+ size_t rem;
bdev = container_of(dev, struct bonding_device, dev);
if ((cur = tb[BOND_ATTR_POLICY]) != NULL) {
const char *policy = blobmsg_get_string(cur);
- int i;
+ size_t i;
for (i = 0; i < ARRAY_SIZE(bonding_policy_str); i++) {
if (strcmp(policy, bonding_policy_str[i]) != 0)
bonding_remove_port(bp);
- device_lock();
-
device_remove_user(&bp->dev);
/*
device_set_present(dev, true);
}
- device_unlock();
-
free(bp);
}