Skip to content

Commit

Permalink
nvmet: free smart-log buffer after use
Browse files Browse the repository at this point in the history
Free smart-log buffer allocated in the function after use.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Chaitanya Kulkarni authored and Christoph Hellwig committed Jun 11, 2018
1 parent 94423a8 commit c42d7a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nvme/target/admin-cmd.c
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit c42d7a3

Please sign in to comment.