greybus: core: clean up ida memory for host controller
authorGreg Kroah-Hartman <gregkh@google.com>
Mon, 27 Jul 2015 21:23:44 +0000 (14:23 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 28 Jul 2015 21:47:03 +0000 (14:47 -0700)
We forgot to free any ida internal structures that were used by this
host controller structure when we free the memory for the controller.
So fix that up by doing so in the release function.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/staging/greybus/core.c

index 49a28ba532dcd4184c9550b0323827f0a7fa2ba2..7d5cd99157f5730b1cf95ccdefd5507943596ad6 100644 (file)
@@ -161,6 +161,7 @@ static void free_hd(struct kref *kref)
 
        hd = container_of(kref, struct greybus_host_device, kref);
 
+       ida_destroy(&hd->cport_id_map);
        kfree(hd);
        mutex_unlock(&hd_mutex);
 }