Skip to contentSkip to conversation

uprobes: add_utask() returns an ERR_PTR() not NULL

PATCH New Dan Carpenter 1 participant 1 message Nov 24, 2011 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uprobes: add_utask() returns an ERR_PTR() not NULL

We need to check for IS_ERR() here (add_utask() never returns NULL).

kernel/uprobes.c +3 -1
index 2493191..3360057 100644
@@ -1387,8 +1387,10 @@ void uprobe_notify_resume(struct pt_regs *regs)
 		if (!utask) {
 			utask = add_utask();
 			/* Cannot Allocate; re-execute the instruction. */
-			if (!utask)
+			if (IS_ERR(utask)) {
+				utask = NULL;
 				goto cleanup_ret;
+			}
 		}
 		utask->active_uprobe = u;
 		handler_chain(u, regs);