From 5a4ac30c7a15712d01110befec1acfe86c2cbed0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 27 Sep 2021 18:56:21 +0200 Subject: netifd: rework/fix device free handling Instead of explicitly preventing free in specific code sections using device_lock/device_unlock, defer all device free handling via uloop timeout This avoids an entire class of lurking use-after-free bugs triggered by device event processing and simplifies the code Signed-off-by: Felix Fietkau --- bonding.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'bonding.c') diff --git a/bonding.c b/bonding.c index 0bf4f9a..457fe51 100644 --- a/bonding.c +++ b/bonding.c @@ -566,8 +566,6 @@ bonding_free_port(struct bonding_port *bp) bonding_remove_port(bp); - device_lock(); - device_remove_user(&bp->dev); /* @@ -582,8 +580,6 @@ bonding_free_port(struct bonding_port *bp) device_set_present(dev, true); } - device_unlock(); - free(bp); } -- cgit v1.2.1