Skip to contentSkip to conversation

nvmet: fix the error of point math issue

PATCH In review Guixin Liu 4 participants 5 messages Nov 11, 2024 – Nov 12, 2024

Subsystems (2)
lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

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
index bef82135a0e7..550effcfb9ad 100644
@@ -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
#1 lore raw
Quoted 5 lines · Guixin Liu

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.

This needs a Fixes tag so that the stable tools know not to apply it to old kernels.

regards,
dan carpenter

#2 lore raw
Quoted 9 lines · Dan Carpenter
Quoted 5 lines · Guixin Liu

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.

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.

maintainer
#3 lore raw
In reply to Guixin Liu
Quoted 3 lines · Guixin Liu

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.

Thanks, I folded this inot the original commit.

author
#4 lore raw
Quoted 5 lines · Keith Busch
Quoted 3 lines · Guixin Liu

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.

Thanks, I folded this inot the original commit.

Thanks to fold that.

Best Regards,

Guixin Liu