public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] uprobes: add_utask() returns an ERR_PTR() not NULL
@ 2011-11-24  7:17 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2011-11-24  7:17 UTC (permalink / raw)
  To: Srikar Dronamraju
  Cc: Jim Keniston, Ananth N Mavinakayanahalli, linux-kernel,
	kernel-janitors

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/kernel/uprobes.c b/kernel/uprobes.c
index 2493191..3360057 100644
--- a/kernel/uprobes.c
+++ b/kernel/uprobes.c
@@ -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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-11-24  7:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-24  7:17 [patch] uprobes: add_utask() returns an ERR_PTR() not NULL Dan Carpenter

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