We can't use GFP_KERNEL inside rcu_read_lock().
Signed-off-by: Tetsuo Handa <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
---
mm/kmemleak.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 4ea4510..a617518 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -833,7 +833,7 @@ static void early_alloc(struct early_log *log)
*/
rcu_read_lock();
object = create_object((unsigned long)log->ptr, log->size,
- log->min_count, GFP_KERNEL);
+ log->min_count, GFP_ATOMIC);
spin_lock_irqsave(&object->lock, flags);
for (i = 0; i < log->trace_len; i++)
object->trace[i] = log->trace[i];
This patch adds NULL pointer checking in the early_alloc() function.
Reported-by: Paul E. McKenney <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
---
mm/kmemleak.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index a617518..8bf765c 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -834,11 +834,14 @@ static void early_alloc(struct early_log *log)
rcu_read_lock();
object = create_object((unsigned long)log->ptr, log->size,
log->min_count, GFP_ATOMIC);
+ if (!object)
+ goto out;
spin_lock_irqsave(&object->lock, flags);
for (i = 0; i < log->trace_len; i++)
object->trace[i] = log->trace[i];
object->trace_len = log->trace_len;
spin_unlock_irqrestore(&object->lock, flags);
+out:
rcu_read_unlock();
}
On Fri, 2009-10-09 at 10:30 +0100, Catalin Marinas wrote:
> We can't use GFP_KERNEL inside rcu_read_lock().
>
> Signed-off-by: Tetsuo Handa <[email protected]>
> Signed-off-by: Catalin Marinas <[email protected]>
I mistakenly dropped the author information. The correct patch should
have a "From: Tetsuo" line. I'll re-post in reply to this message.
--
Catalin
From: Tetsuo Handa <[email protected]>
We can't use GFP_KERNEL inside rcu_read_lock().
Signed-off-by: Tetsuo Handa <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
---
Please ignore [PATCH 1/2] with the same subject as it didn't have the
correct author information. Thanks.
mm/kmemleak.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 4ea4510..a617518 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -833,7 +833,7 @@ static void early_alloc(struct early_log *log)
*/
rcu_read_lock();
object = create_object((unsigned long)log->ptr, log->size,
- log->min_count, GFP_KERNEL);
+ log->min_count, GFP_ATOMIC);
spin_lock_irqsave(&object->lock, flags);
for (i = 0; i < log->trace_len; i++)
object->trace[i] = log->trace[i];
On Fri, Oct 9, 2009 at 12:30 PM, Catalin Marinas
<[email protected]> wrote:
> This patch adds NULL pointer checking in the early_alloc() function.
>
> Reported-by: Paul E. McKenney <[email protected]>
> Signed-off-by: Catalin Marinas <[email protected]>
Acked-by: Pekka Enberg <[email protected]>
> ---
> ?mm/kmemleak.c | ? ?3 +++
> ?1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index a617518..8bf765c 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -834,11 +834,14 @@ static void early_alloc(struct early_log *log)
> ? ? ? ?rcu_read_lock();
> ? ? ? ?object = create_object((unsigned long)log->ptr, log->size,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? log->min_count, GFP_ATOMIC);
> + ? ? ? if (!object)
> + ? ? ? ? ? ? ? goto out;
> ? ? ? ?spin_lock_irqsave(&object->lock, flags);
> ? ? ? ?for (i = 0; i < log->trace_len; i++)
> ? ? ? ? ? ? ? ?object->trace[i] = log->trace[i];
> ? ? ? ?object->trace_len = log->trace_len;
> ? ? ? ?spin_unlock_irqrestore(&object->lock, flags);
> +out:
> ? ? ? ?rcu_read_unlock();
> ?}
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at ?http://www.tux.org/lkml/
>
On Fri, Oct 09, 2009 at 10:30:34AM +0100, Catalin Marinas wrote:
> This patch adds NULL pointer checking in the early_alloc() function.
Acked-by: Paul E. McKenney <[email protected]>
> Reported-by: Paul E. McKenney <[email protected]>
> Signed-off-by: Catalin Marinas <[email protected]>
> ---
> mm/kmemleak.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index a617518..8bf765c 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -834,11 +834,14 @@ static void early_alloc(struct early_log *log)
> rcu_read_lock();
> object = create_object((unsigned long)log->ptr, log->size,
> log->min_count, GFP_ATOMIC);
> + if (!object)
> + goto out;
> spin_lock_irqsave(&object->lock, flags);
> for (i = 0; i < log->trace_len; i++)
> object->trace[i] = log->trace[i];
> object->trace_len = log->trace_len;
> spin_unlock_irqrestore(&object->lock, flags);
> +out:
> rcu_read_unlock();
> }
>
>