Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: fix the error of point math issue
@ 2024-11-11 10:40 Guixin Liu
  2024-11-11 10:48 ` Dan Carpenter
  2024-11-11 17:54 ` Keith Busch
  0 siblings, 2 replies; 5+ messages in thread
From: Guixin Liu @ 2024-11-11 10:40 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Dan Carpenter
  Cc: linux-nvme, oe-kbuild-all

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.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
 drivers/nvme/target/pr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/pr.c b/drivers/nvme/target/pr.c
index bef82135a0e7..550effcfb9ad 100644
--- a/drivers/nvme/target/pr.c
+++ b/drivers/nvme/target/pr.c
@@ -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.
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-12  1:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11 10:40 [PATCH] nvmet: fix the error of point math issue Guixin Liu
2024-11-11 10:48 ` Dan Carpenter
2024-11-11 11:35   ` Christoph Hellwig
2024-11-11 17:54 ` Keith Busch
2024-11-12  1:32   ` Guixin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox