nvmet: fix the error of point math issue
Subsystems (2)
PATCH 1/1 nvmet: fix the error of point math issue
Fix the wrong place of parenthesis of ctrl_eds and data point in nvmet_execute_pr_report(), switch to "void *" first and then do the addtion.
--- drivers/nvme/target/pr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/target/pr.c +2 -2
@@ -848,8 +848,8 @@ static void nvmet_execute_pr_report(struct nvmet_req *req)/* * continue to get the number of all registrans. */ -if ((void *)(ctrl_eds +sizeof (*ctrl_eds)) > - (void *)(data + num_bytes)) +if (((void *)ctrl_eds +sizeof (*ctrl_eds)) > + ((void *)data + num_bytes))continue ;/* * Dynamic controller, set cntlid to 0xffff.
Signature · 1 line
2.43.0
Quoted 5 lines · Guixin Liu
Fix the wrong place of parenthesis of
ctrl_edsand data point innvmet_execute_pr_report(), switch to "void *" first and then do the addtion.Signed-off-by Guixin Liu <[email protected]>
This needs a Fixes tag so that the stable tools know not to apply it to old kernels.
regards,
dan carpenter
Christoph Hellwig
maintainerQuoted 9 lines · Dan Carpenter
Quoted 5 lines · Guixin Liu
Fix the wrong place of parenthesis of
ctrl_edsand data point innvmet_execute_pr_report(), switch to "void *" first and then do the addtion.Signed-off-by Guixin Liu <[email protected]>This needs a Fixes tag so that the stable tools know not to apply it to old kernels.
We might still be able to fold it in as it's near the top of the nvme tree not send upstream yet.
Keith Busch
maintainerQuoted 3 lines · Guixin Liu
Fix the wrong place of parenthesis of
ctrl_edsand data point innvmet_execute_pr_report(), switch to "void *" first and then do the addtion.
Thanks, I folded this inot the original commit.
Quoted 5 lines · Keith Busch
Quoted 3 lines · Guixin Liu
Fix the wrong place of parenthesis of
ctrl_edsand data point innvmet_execute_pr_report(), switch to "void *" first and then do the addtion.Thanks, I folded this inot the original commit.
Thanks to fold that.
Best Regards,
Guixin Liu