public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] uprobes: add_utask() returns an ERR_PTR() not NULL
Date: Thu, 24 Nov 2011 07:17:16 +0000	[thread overview]
Message-ID: <20111124071716.GA14122@elgon.mountain> (raw)

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);

                 reply	other threads:[~2011-11-24  7:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111124071716.GA14122@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=ananth@in.ibm.com \
    --cc=jkenisto@us.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srikar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox