lkml.org 
[lkml]   [2016]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/1] mm/percpu.c: fix memory leakage issue when allocate a odd alignment area
On Wed 12-10-16 16:44:31, zijun_hu wrote:
> On 10/12/2016 04:25 PM, Michal Hocko wrote:
> > On Wed 12-10-16 15:24:33, zijun_hu wrote:
[...]
> >> i found the following code segments in mm/vmalloc.c
> >> static struct vmap_area *alloc_vmap_area(unsigned long size,
> >> unsigned long align,
> >> unsigned long vstart, unsigned long vend,
> >> int node, gfp_t gfp_mask)
> >> {
> >> ...
> >>
> >> BUG_ON(!size);
> >> BUG_ON(offset_in_page(size));
> >> BUG_ON(!is_power_of_2(align));
> >
> > See a recent Linus rant about BUG_ONs. These BUG_ONs are quite old and
> > from a quick look they are even unnecessary. So rather than adding more
> > of those, I think removing those that are not needed is much more
> > preferred.
> >
> i notice that, and the above code segments is used to illustrate that
> input parameter checking is necessary sometimes

Why do you think it is necessary here?

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2016-10-12 11:55    [W:0.049 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site