This patch fixes the following bug:

BUG: unable to handle kernel paging request at fffffffffffffffe
IP: [<ffffffff8032e80e>] strcmp+0x5/0x19
PGD 203067 PUD 204067 PMD 0
Oops: 0000 [#1] SMP
last sysfs file: /sys/kernel/perfmon/version
CPU 7
Modules linked in:
Pid: 5135, comm: ibs_sampling Not tainted 
2.6.28-perfmon-x86_64-standard-00431-gec92131 #1
RIP: 0010:[<ffffffff8032e80e>]  [<ffffffff8032e80e>] strcmp+0x5/0x19
RSP: 0018:ffff88042f1d1e60  EFLAGS: 00010287
RAX: 0000000000000064 RBX: ffffffff807430e0 RCX: ffff88042f1d1f10
RDX: 0000000000000064 RSI: fffffffffffffffe RDI: ffffffff806b37b4
RBP: fffffffffffffffe R08: ffff88042f1d1f10 R09: 0000000000000000
R10: 00007fc1561cc6f0 R11: 0000000000000206 R12: 00007fc1561cc6f0
R13: 0000000000000000 R14: ffff88042f1d1f18 R15: 0000000000000040
FS:  00007fc1561cc6f0(0000) GS:ffff88042f99df40(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: fffffffffffffffe CR3: 000000042d990000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process ibs_sampling (pid: 5135, threadinfo ffff88042f1d0000, task 
ffff88042fb5d8d0)
Stack:
 ffffffff803299c4 ffff88042f1d1f10 fffffffffffffffe 00007fc1561cc6f0
 ffffffff80329a05 fffffffffffffffe ffffffff80328501 ffff88042db0d1e0
 ffff88042f1d1f10 ffff88042f1d1f08 00007fff5e1d2110 00007fff5e1d1fc0
Call Trace:
 [<ffffffff803299c4>] ? pfm_find_fmt+0x2c/0x55
 [<ffffffff80329a05>] ? pfm_smpl_fmt_get+0x18/0x5c
 [<ffffffff80328501>] ? pfm_get_smpl_arg+0x84/0x1c7
 [<ffffffff803224a6>] ? sys_pfm_create_context+0xcd/0x109
 [<ffffffff802652ed>] ? do_munmap+0x298/0x2b3
 [<ffffffff8020b20b>] ? system_call_fastpath+0x16/0x1b
Code: 14 08 72 04 0f 0b eb fe 4d 29 c1 4d 01 c2 49 8d 41 ff 4c 39 c9 4c 89 d7 
fc 48 0f 43 c8 48 89 d0 f3 a4 c6 07 00 c3 0f b6 17 89 d0 <2a> 06 48 ff c6 84 c0 
75 07 48 ff c7 84 d2 75 eb 0f be c0 c3 31
RIP  [<ffffffff8032e80e>] strcmp+0x5/0x19
 RSP <ffff88042f1d1e60>
CR2: fffffffffffffffe
---[ end trace 548f9728b73203d7 ]---

Signed-off-by: Robert Richter <robert.rich...@amd.com>
---
 perfmon/perfmon_smpl.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/perfmon/perfmon_smpl.c b/perfmon/perfmon_smpl.c
index e31fb15..a6e26d7 100644
--- a/perfmon/perfmon_smpl.c
+++ b/perfmon/perfmon_smpl.c
@@ -811,9 +811,10 @@ int pfm_get_smpl_arg(char __user *fmt_uname, void __user 
*fmt_uarg, size_t usize
        int ret;
 
        fmt_name = getname(fmt_uname);
-       if (!fmt_name) {
-               PFM_DBG("getname failed");
-               return -ENOMEM;
+       ret = PTR_ERR(fmt_name);
+       if (IS_ERR(fmt_name)) {
+               PFM_DBG("getname failed: %d", ret);
+               return ret;
        }
 
        /*
-- 
1.6.1



------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to