From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12111 invoked by alias); 14 Mar 2011 18:10:17 -0000 Received: (qmail 12101 invoked by uid 22791); 14 Mar 2011 18:10:14 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mout.perfora.net (HELO mout.perfora.net) (74.208.4.195) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Mar 2011 18:10:10 +0000 Received: from localhost (bas3-london14-1096786305.dsl.bell.ca [65.95.161.129]) by mrelay.perfora.net (node=mrus2) with ESMTP (Nemesis) id 0M9KLu-1PmZxS2nxm-00CBiH; Mon, 14 Mar 2011 14:09:35 -0400 Date: Mon, 14 Mar 2011 18:10:00 -0000 From: Stephen Wilson To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Ananth N Mavinakayanahalli , Christoph Hellwig , Andi Kleen , Masami Hiramatsu , Oleg Nesterov , LKML , Jim Keniston , Roland McGrath , SystemTap , Andrew Morton , "Paul E. McKenney" Subject: Re: [PATCH v2 2.6.38-rc8-tip 7/20] 7: uprobes: store/restore original instruction. Message-ID: <20110314180914.GA18855@fibrous.localdomain> References: <20110314133403.27435.7901.sendpatchset@localhost6.localdomain6> <20110314133522.27435.45121.sendpatchset@localhost6.localdomain6> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110314133522.27435.45121.sendpatchset@localhost6.localdomain6> User-Agent: Mutt/1.5.19 (2009-01-05) Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2011-q1/txt/msg00384.txt.bz2 On Mon, Mar 14, 2011 at 07:05:22PM +0530, Srikar Dronamraju wrote: > static int install_uprobe(struct mm_struct *mm, struct uprobe *uprobe) > { > - int ret = 0; > + struct task_struct *tsk; > + int ret = -EINVAL; > > - /*TODO: install breakpoint */ > - if (!ret) > + get_task_struct(mm->owner); > + tsk = mm->owner; > + if (!tsk) > + return ret; I think you need to check that tsk != NULL before calling get_task_struct()... > static int remove_uprobe(struct mm_struct *mm, struct uprobe *uprobe) > { > - int ret = 0; > + struct task_struct *tsk; > + int ret; > + > + get_task_struct(mm->owner); > + tsk = mm->owner; > + if (!tsk) > + return -EINVAL; And here as well. -- steve