uprobes: fix WARN() inside hprobe_consume()
Subsystems (4)
Andrii Nakryiko
maintainerPATCH 1/1 uprobes: fix WARN() inside hprobe_consume()
Use proper *hstate to print unexpected hprobe state. And drop unused local state variable.
Reported-by kernel test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
Fixes 72a27524a493 ("uprobes: SRCU-protect uretprobe lifetime (with timeout)")
Signed-off-by Andrii Nakryiko <[email protected]>
--- kernel/events/uprobes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/events/uprobes.c +1 -3
@@ -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_scase 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 ; } }
Signature · 1 line
2.43.5
Peter Zijlstra
maintainerQuoted 8 lines · Andrii Nakryiko
Use proper
*hstateto print unexpected hprobe state. And drop unused localstatevariable.Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Fixes 72a27524a493 ("uprobes: SRCU-protect uretprobe lifetime (with timeout)")Signed-off-by Andrii Nakryiko <[email protected]>
Since I've not yet pushed it out to tip, I've folded it into the original patch.