Skip to content

Commit

Permalink
nvmet: for nvme admin set_features cmd, call nvmet_check_data_len_lte()
Browse files Browse the repository at this point in the history
This is due to the fact that the host is allowed to pass the controller
an sgl describing a buffer that is larger than the payload itself

Signed-off-by: Amit Engel <Amit.Engel@dell.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Amit Engel authored and Christoph Hellwig committed Feb 1, 2023
1 parent 9960784 commit ddf9171
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/target/admin-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ void nvmet_execute_set_features(struct nvmet_req *req)
u16 nsqr;
u16 ncqr;

if (!nvmet_check_transfer_len(req, 0))
if (!nvmet_check_data_len_lte(req, 0))
return;

switch (cdw10 & 0xff) {
Expand Down

0 comments on commit ddf9171

Please sign in to comment.