login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
June
»
17
Re: [patch] x86, pat: freeing invalid memtype messages
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Marcin Slusarz
Subject:
Re: [patch] x86, pat: freeing invalid memtype messages
Date: Thursday, June 17, 2010 - 9:17 am
On Thu, Jun 17, 2010 at 03:45:59PM +0200, Dan Carpenter wrote:
quoted text
> Commit 20413f27163 "x86, pat: Fix memory leak in free_memtype" added an > error message in free_memtype() if rbt_memtype_erase() returns NULL. > The problem is that if CONFIG_X86_PAT is enabled, we use a different > implimentation of rbt_memtype_erase() that always returns NULL. > > I've modified rbt_memtype_erase() to return an ERR_PTR() on errors and > made free_memtype() check for that instead. > > Addresses:
https://bugzilla.kernel.org/show_bug.cgi?id=16205
> > Signed-off-by: Dan Carpenter <error27@gmail.com>
This patch is probably ok, but it does not address my bug. I have CONFIG_X86_PAT=y, so rbt_memtype_erase does not always return NULL.
quoted text
> diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c > index acc15b2..81b7735 100644 > --- a/arch/x86/mm/pat.c > +++ b/arch/x86/mm/pat.c > @@ -359,10 +359,10 @@ int free_memtype(u64 start, u64 end) > entry = rbt_memtype_erase(start, end); > spin_unlock(&memtype_lock); > > - if (!entry) { > + if (IS_ERR(entry)) { > printk(KERN_INFO "%s:%d freeing invalid memtype %Lx-%Lx\n", > current->comm, current->pid, start, end); > - return -EINVAL; > + return PTR_ERR(entry); > } > > kfree(entry); > diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c > index f537087..90e5cbe 100644 > --- a/arch/x86/mm/pat_rbtree.c > +++ b/arch/x86/mm/pat_rbtree.c > @@ -236,8 +236,10 @@ struct memtype *rbt_memtype_erase(u64 start, u64 end) > struct memtype *data; > > data = memtype_rb_exact_match(&memtype_rbroot, start, end); > - if (!data) > + if (!data) { > + data = ERR_PTR(-EINVAL); > goto out; > + } > > rb_erase(&data->rb, &memtype_rbroot); > out: > >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[patch] x86, pat: freeing invalid memtype messages
, Dan Carpenter
, (Thu Jun 17, 6:45 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Marcin Slusarz
, (Thu Jun 17, 9:17 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Dan Carpenter
, (Thu Jun 17, 9:33 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Xiaotian Feng
, (Thu Jun 17, 6:58 pm)
Re: [patch] x86, pat: freeing invalid memtype messages
, Xiaotian Feng
, (Thu Jun 17, 11:47 pm)
Re: [patch] x86, pat: freeing invalid memtype messages
, Marcin Slusarz
, (Fri Jun 18, 10:57 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Xiaotian Feng
, (Mon Jun 21, 3:56 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Peter Zijlstra
, (Mon Jun 21, 4:02 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Xiaotian Feng
, (Mon Jun 21, 4:07 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Marcin Slusarz
, (Mon Jun 21, 8:33 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Peter Zijlstra
, (Mon Jun 21, 8:41 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Suresh Siddha
, (Mon Jun 21, 10:54 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Venkatesh Pallipadi
, (Mon Jun 21, 11:08 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Venkatesh Pallipadi
, (Mon Jun 21, 11:38 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Marcin Slusarz
, (Mon Jun 21, 11:41 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Marcin Slusarz
, (Mon Jun 21, 11:56 am)
Re: [patch] x86, pat: freeing invalid memtype messages
, Xiaotian Feng
, (Mon Jun 21, 7:45 pm)
Re: [patch] x86, pat: freeing invalid memtype messages
, Venkatesh Pallipadi
, (Mon Jun 21, 8:47 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Jesse Barnes
Re: [stable] [BUG][PATCH] cpqphp: fix kernel NULL pointer dereference
Greg KH
[003/136] p54usb: add Zcomax XG-705A usbid
Magnus Damm
[PATCH 03/07] ARM: Use shared GIC entry macros on Realview
Oliver Neukum
Re: [Bug #13682] The webcam stopped working when upgrading from 2.6.29 to 2.6.30
Martin Schwidefsky
Re: [PATCH] optimized ktime_get[_ts] for GENERIC_TIME=y
git
:
Junio C Hamano
Re: Some advanced index playing
Jeff King
Re: confusion over the new branch and merge config
Robin Rosenberg
Re: cvs2svn conversion directly to git ready for experimentation
Linus Torvalds
git binary size...
Ævar Arnfjörð Bjarmason
Re: Challenge with Git-Bash
git-commits-head
:
Linux Kernel Mailing List
md: move allocation of ->queue from mddev_find to md_probe
Linux Kernel Mailing List
md: raid0: Represent zone->zone_offset in sectors.
Linux Kernel Mailing List
[ARM] S3C24XX: Add gpio_to_irq() facility
Linux Kernel Mailing List
md: raid0_make_request(): Replace local variable block by sector.
Linux Kernel Mailing List
md: Allow md devices to be created by name.
linux-netdev
:
kaber
[PATCH 07/12] netfilter: xtables: change hotdrop pointer to direct modification
Gerrit Renker
[PATCH 3/5] dccp ccid-2: Remove redundant sanity tests
David Miller
Re: [PATCH net-next-2.6] pcnet32: Remove redundant set of skb->dev
Gerrit Renker
[PATCH 4/5] dccp ccid-2: Simplify dec_pipe and rearming of RTO timer
Saikiran Madugula
[PATCH] Allow fragmentation of VLAN packets traversing a bridge.