diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index 9625328427690345b86f73c4a80e0c1035635e4b..38803576d5e122396ae25f1a675d48fd268f67ac 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -119,9 +119,11 @@ static void nvmet_execute_get_log_page_smart(struct nvmet_req *req) else status = nvmet_get_smart_log_nsid(req, log); if (status) - goto out; + goto out_free_log; status = nvmet_copy_to_sgl(req, 0, log, sizeof(*log)); +out_free_log: + kfree(log); out: nvmet_req_complete(req, status); }