summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'device.c')
-rw-r--r--device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/device.c b/device.c
index 56fc3f7..feeb290 100644
--- a/device.c
+++ b/device.c
@@ -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;