Re: mpol_to_str revisited.

From: David Rientjes
Date: Mon Oct 15 2012 - 20:48:26 EST


On Mon, 8 Oct 2012, Dave Jones wrote:

> > > diff -durpN '--exclude-from=/home/davej/.exclude' src/git-trees/kernel/linux/fs/proc/task_mmu.c linux-dj/fs/proc/task_mmu.c
> > > --- src/git-trees/kernel/linux/fs/proc/task_mmu.c 2012-05-31 22:32:46.778150675 -0400
> > > +++ linux-dj/fs/proc/task_mmu.c 2012-10-04 19:31:41.269988984 -0400
> > > @@ -1162,6 +1162,7 @@ static int show_numa_map(struct seq_file
> > > struct mm_walk walk = {};
> > > struct mempolicy *pol;
> > > int n;
> > > + int ret;
> > > char buffer[50];
> > >
> > > if (!mm)
> > > @@ -1178,7 +1179,11 @@ static int show_numa_map(struct seq_file
> > > walk.mm = mm;
> > >
> > > pol = get_vma_policy(proc_priv->task, vma, vma->vm_start);
> > > - mpol_to_str(buffer, sizeof(buffer), pol, 0);
> > > + memset(buffer, 0, sizeof(buffer));
> > > + ret = mpol_to_str(buffer, sizeof(buffer), pol, 0);
> > > + if (ret < 0)
> > > + return 0;
> >
> > We should need the mpol_cond_put(pol) here before returning.
>
> good catch. I'll respin the patch later with this changed.
>

Did you get a chance to fix this issue?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/