From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Thu, 24 Nov 2011 07:17:16 +0000 Subject: [patch] uprobes: add_utask() returns an ERR_PTR() not NULL Message-Id: <20111124071716.GA14122@elgon.mountain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Srikar Dronamraju Cc: Jim Keniston , Ananth N Mavinakayanahalli , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org We need to check for IS_ERR() here (add_utask() never returns NULL). Signed-off-by: Dan Carpenter 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);