]> git.baikalelectronics.ru Git - kernel.git/commit
virtio: fix memory leak of virtio ida cache layers
authorSuman Anna <s-anna@ti.com>
Thu, 17 Sep 2015 00:29:17 +0000 (19:29 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 7 Dec 2015 15:28:01 +0000 (17:28 +0200)
commit01c83522900f6617e94db5d4ac22669182fc111f
tree353f94e6bd5dace0868a833a35787b849f060e3f
parent961b9a34b24a151737a70ce3eea230925b863d5b
virtio: fix memory leak of virtio ida cache layers

The virtio core uses a static ida named virtio_index_ida for
assigning index numbers to virtio devices during registration.
The ida core may allocate some internal idr cache layers and
an ida bitmap upon any ida allocation, and all these layers are
truely freed only upon the ida destruction. The virtio_index_ida
is not destroyed at present, leading to a memory leak when using
the virtio core as a module and atleast one virtio device is
registered and unregistered.

Fix this by invoking ida_destroy() in the virtio core module
exit.

Cc: stable@vger.kernel.org
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio.c