From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754191Ab1KXHSu (ORCPT ); Thu, 24 Nov 2011 02:18:50 -0500 Received: from acsinet15.oracle.com ([141.146.126.227]:18989 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753273Ab1KXHSs (ORCPT ); Thu, 24 Nov 2011 02:18:48 -0500 Date: Thu, 24 Nov 2011 10:17:16 +0300 From: Dan Carpenter To: Srikar Dronamraju Cc: Jim Keniston , Ananth N Mavinakayanahalli , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] uprobes: add_utask() returns an ERR_PTR() not NULL Message-ID: <20111124071716.GA14122@elgon.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090203.4ECDEF95.0002,ss=1,re=0.000,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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);