lkml.org 
[lkml]   [2009]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [RFC][PATCH] kmemdup_from_user(): introduce
    Date
    > On Fri, Mar 06, 2009 at 12:39:00AM -0800, Andrew Morton wrote:
    > > On Fri, 06 Mar 2009 16:27:53 +0800 Li Zefan <lizf@cn.fujitsu.com> wrote:
    > >
    > > > > Let's not add wrapper for every two lines that happen to be used
    > > > > together.
    > > > >
    > > >
    > > > Why not if we have good reasons? And I don't think we can call this
    > > > "happen to" if there are 250+ of them?
    > >
    > > The change is a good one. If a reviewer (me) sees it then you know the
    > > code's all right and the review effort becomes less - all you need to check
    > > is that the call site is using IS_ERR/PTR_ERR and isn't testing for
    > > NULL. Less code, less chance for bugs.
    > >
    > > Plus it makes kernel text smaller.
    > >
    > > Yes, the name is a bit cumbersome.
    >
    > Some do NUL-termination afterwards and allocate "len + 1", but copy "len".
    > Some don't care.

    if subsystem want string data, it should use strndup_user().
    memdump don't need to care NUL-termination

    In addition, also I often review various mm code and patch, I also like
    this change.





    \
     
     \ /
      Last update: 2009-03-06 10:11    [W:2.402 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site