diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-12-16 11:06:57 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-12-16 11:06:57 +0100 |
commit | 1a770b186b4bc9e714dbdd30d0c41ea471fa8245 (patch) | |
tree | 681395ecd319f2a0de1f628d7afa43626845b1b5 /device.c | |
parent | 2851c3bcde8c23f6535b13c80fc486569c288ec7 (diff) |
device: prevent callbacks to device users that have been cleaned up already
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -185,6 +185,10 @@ static int device_broadcast_cb(void *ctx, struct safe_list *list) struct device_user *dep = container_of(list, struct device_user, list); int *ev = ctx; + /* device might have been removed by an earlier callback */ + if (!dep->dev) + return 0; + if (dep->cb) dep->cb(dep, *ev); return 0; |