Browse Source

Bugfix: Dereference udev monitor events when done with them

Luke Dashjr 11 years ago
parent
commit
e3bb32fa25
1 changed files with 3 additions and 4 deletions
  1. 3 4
      miner.c

+ 3 - 4
miner.c

@@ -11190,10 +11190,9 @@ void *hotplug_thread(__maybe_unused void *p)
 			continue;
 		const char * const action = udev_device_get_action(device);
 		applog(LOG_DEBUG, "%s: Received %s event", __func__, action);
-		if (strcmp(action, "add"))
-			continue;
-		
-		pending = true;
+		if (!strcmp(action, "add"))
+			pending = true;
+		udev_device_unref(device);
 	}
 	
 	applogfailr(NULL, LOG_ERR, "epoll_wait");