Skip to content

Commit bb9f4cc

Browse files
israelrukeithbusch
authored andcommitted
nvme-auth: use kvfree() for memory allocated with kvcalloc()
Memory allocated by kvcalloc() may come from vmalloc or kmalloc, so use kvfree() instead of kfree() for proper deallocation. Fixes: aa36d71 ("nvme-auth: convert dhchap_auth_list to an array") Signed-off-by: Israel Rukshin <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 5c8d134 commit bb9f4cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/nvme/host/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ void nvme_auth_free(struct nvme_ctrl *ctrl)
11221122
if (ctrl->dhchap_ctxs) {
11231123
for (i = 0; i < ctrl_max_dhchaps(ctrl); i++)
11241124
nvme_auth_free_dhchap(&ctrl->dhchap_ctxs[i]);
1125-
kfree(ctrl->dhchap_ctxs);
1125+
kvfree(ctrl->dhchap_ctxs);
11261126
}
11271127
if (ctrl->host_key) {
11281128
nvme_auth_free_key(ctrl->host_key);

0 commit comments

Comments
 (0)