summaryrefslogtreecommitdiffstats
path: root/ui/common
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-02-01 16:28:38 +1100
committerJeremy Kerr <jk@ozlabs.org>2009-02-01 16:28:38 +1100
commit5e53907420e5600b7f4cfb51bcd270ec52c5462f (patch)
treef29d0304bb572b65c488584150436a95e3a8e2ce /ui/common
parentf5192075ca25e91ae72f12c89cab0c9c66eb6606 (diff)
downloadtalos-petitboot-5e53907420e5600b7f4cfb51bcd270ec52c5462f.tar.gz
talos-petitboot-5e53907420e5600b7f4cfb51bcd270ec52c5462f.zip
[discover client] Remove device from discover array before notifying UI
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/common')
-rw-r--r--ui/common/discover-client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c
index 7c2e27d..ff0ab40 100644
--- a/ui/common/discover-client.c
+++ b/ui/common/discover-client.c
@@ -107,10 +107,6 @@ static void remove_device(struct discover_client *client, const char *id)
if (!device)
return;
- client->ops.remove_device(device, client->ops.cb_arg);
-
- talloc_free(device);
-
/* remove the device from the client's device array */
client->n_devices--;
memmove(&client->devices[i], &client->devices[i+1],
@@ -118,6 +114,10 @@ static void remove_device(struct discover_client *client, const char *id)
client->devices = talloc_realloc(client, client->devices,
struct device *, client->n_devices);
+ /* notify the UI */
+ client->ops.remove_device(device, client->ops.cb_arg);
+
+ talloc_free(device);
}
int discover_client_process(struct discover_client *client)
OpenPOWER on IntegriCloud