From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with SMTP id 798278D003A for ; Mon, 14 Mar 2011 14:09:51 -0400 (EDT) Date: Mon, 14 Mar 2011 14:09:14 -0400 From: Stephen Wilson 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> Sender: owner-linux-mm@kvack.org List-ID: 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" 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 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org