[PATCH perf/core] uprobes: fix WARN() inside hprobe_consume()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use proper `*hstate` to print unexpected hprobe state. And drop unused
local `state` variable.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Closes: https://lore.kernel.org/r/202410302020.1jHBLfss-lkp@xxxxxxxxx/
Fixes: 72a27524a493 ("uprobes: SRCU-protect uretprobe lifetime (with timeout)")
Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
---
 kernel/events/uprobes.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 998a9726b80f..f2beb4b3f5c5 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -704,8 +704,6 @@ static void hprobe_init_stable(struct hprobe *hprobe, struct uprobe *uprobe)
  */
 static inline struct uprobe *hprobe_consume(struct hprobe *hprobe, enum hprobe_state *hstate)
 {
-	enum hprobe_state state;
-
 	*hstate = xchg(&hprobe->state, HPROBE_CONSUMED);
 	switch (*hstate) {
 	case HPROBE_LEASED:
@@ -715,7 +713,7 @@ static inline struct uprobe *hprobe_consume(struct hprobe *hprobe, enum hprobe_s
 	case HPROBE_CONSUMED:	/* uprobe was finalized already, do nothing */
 		return NULL;
 	default:
-		WARN(1, "hprobe invalid state %d", state);
+		WARN(1, "hprobe invalid state %d", *hstate);
 		return NULL;
 	}
 }
-- 
2.43.5





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux