linux-mips
[Top] [All Lists]

Re: [PATCH 1/4] MIPS Kprobes: Fix OOPS in arch_prepare_kprobe()

To: "manesoni@cisco.com" <manesoni@cisco.com>
Subject: Re: [PATCH 1/4] MIPS Kprobes: Fix OOPS in arch_prepare_kprobe()
From: David Daney <david.daney@cavium.com>
Date: Tue, 08 Nov 2011 11:57:45 -0800
Cc: Ralf Baechle <ralf@linux-mips.org>, "ananth@in.ibm.com" <ananth@in.ibm.com>, "kamensky@cisco.com" <kamensky@cisco.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
In-reply-to: <20111108170454.GB16526@cisco.com>
References: <20111108170336.GA16526@cisco.com> <20111108170454.GB16526@cisco.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10
On 11/08/2011 09:04 AM, Maneesh Soni wrote:
[...]

diff --git a/arch/mips/kernel/kprobes.c b/arch/mips/kernel/kprobes.c
index ee28683..9fb1876 100644
--- a/arch/mips/kernel/kprobes.c
+++ b/arch/mips/kernel/kprobes.c
@@ -25,6 +25,7 @@

  #include<linux/kprobes.h>
  #include<linux/preempt.h>
+#include<linux/uaccess.h>
  #include<linux/kdebug.h>
  #include<linux/slab.h>

@@ -118,11 +119,19 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
        union mips_instruction prev_insn;
        int ret = 0;

-       prev_insn = p->addr[-1];
        insn = p->addr[0];

-       if (insn_has_delayslot(insn) || insn_has_delayslot(prev_insn)) {
-               pr_notice("Kprobes for branch and jump instructions are not 
supported\n");
+       if (insn_has_delayslot(insn)) {
+               pr_notice("Kprobes for branch and jump instructions are not"
+                         "supported\n");

Don't wrap these strings.

It is better to go a little bit over 80 columns, than have this.

David Daney


<Prev in Thread] Current Thread [Next in Thread>