On Mon, Mar 28, 2011 at 8:26 AM, Amerigo Wang<amwang@xxxxxxxxxx> wrote:From: WANG Cong<xiyou.wangcong@xxxxxxxxx>
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 7c708a4..8e59169 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -124,8 +124,10 @@ static void *m_start(struct seq_file *m, loff_t *pos)
return ERR_PTR(-ESRCH);
mm = mm_for_maps(priv->task);
- if (!mm || IS_ERR(mm))
+ if (IS_ERR_OR_NULL(mm)) {
+ put_task_struct(priv->task);
return mm;
+ }
down_read(&mm->mmap_sem);
tail_vma = get_gate_vma(priv->task->mm);
@@ -182,6 +184,8 @@ static void m_stop(struct seq_file *m, void *v)
struct proc_maps_private *priv = m->private;
struct vm_area_struct *vma = v;
+ if (IS_ERR_OR_NULL(v))
+ return;
Note: this is not functional equivalent with the previous patch.
I din't test the above patch.
Linus already have the fix in his tree.