]> www.infradead.org Git - users/sagi/libnvme.git/commit
mi: free endpoints on root destruction
authorJeremy Kerr <jk@codeconstruct.com.au>
Tue, 21 Jun 2022 08:47:18 +0000 (16:47 +0800)
committerJeremy Kerr <jk@codeconstruct.com.au>
Fri, 24 Jun 2022 07:42:50 +0000 (15:42 +0800)
commit97a16dc89797d88793801ed81e71b69ee138aeec
tree38bb14ff029166ec34616622aebc82d8b4df0721
parentbb70b874dac13a15c37ce1dd1de866d6a5dd428d
mi: free endpoints on root destruction

The root_t object needs to persist through the lifetime of an endpoint,
so close the endpoints on nvme_mi_free_root, and track allocated
endpoints in the root->endpoints list.

To do the destruction safely, we need a _safe variant of the endpoint
iterator macro.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
src/nvme/mi.c
src/nvme/mi.h
test/mi.c