should "get_user_pages()" really be phased out?
poking around mm/gup.c at "get_user_pages()" and related routines, and noticed this: * get_user_pages should be phased out in favor of * get_user_pages_locked|unlocked or get_user_pages_fast. Nothing * should use get_user_pages because it cannot pass * FAULT_FLAG_ALLOW_RETRY to handle_mm_fault. so does that mean what it seems to mean ... that nothing outside of memory management should call get_user_pages() directly? i can see that some of those other routines are implemented in terms of get_user_pages() -- does that mean that get_user_pages() should be made static so that only those routines are allowed to call it, and everyone else should invoke one of the other routines? just trying to understand the eventual desired fate of get_user_pages(). rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
RE: skb_clone related query
> -Original Message- > From: kernelnewbies-boun...@kernelnewbies.org [mailto:kernelnewbies- > boun...@kernelnewbies.org] On Behalf Of pavi1729 > Sent: Monday, December 28, 2015 6:16 AM > To: kernelnewbies@kernelnewbies.org > Subject: skb_clone related query > > Hi, > Just out of curisity, I was looking at Kernel 3.14, skb_clone function in > f_ncm.c > > http://lxr.free- > electrons.com/source/drivers/usb/gadget/f_ncm.c?v=3.14#L1063 > > > QUERY : Shouldn't a kfree_skb(skb2); happen before goto err @1070 ? > Is this not a memleak ? > > > 1068 if (!skb_pull(skb2, index)) { > 1069 ret = -EOVERFLOW; > 1070 goto err; > 1071 } > > > Thanks, > Pavi Looks like an skb leak to me. Though the fix would need to consider the case where skb2 was set equal to skb at line 1061 instead of being cloned. Jeff Haran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies