nvme-core: fix a memory leak in nvme_ns_info_from_identify()
authorMaurizio Lombardi <mlombard@redhat.com>
Thu, 23 Nov 2023 14:07:41 +0000 (15:07 +0100)
committerKeith Busch <kbusch@kernel.org>
Mon, 27 Nov 2023 18:26:43 +0000 (10:26 -0800)
commite3139cef8257fcab1725441e2fd5fd0ccb5481b1
tree9ec04a8124356d1871a29a581906ed3be3e51158
parent136cfcb8dce9bc7a17a8d32e497f4dfe80dd357d
nvme-core: fix a memory leak in nvme_ns_info_from_identify()

In case of error, free the nvme_id_ns structure that was allocated
by nvme_identify_ns().

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c