lkml.org 
[lkml]   [2017]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [PATCHv1 5/7] TAP: Extending tap device create/destroy APIs
    Date


    > -----Original Message-----
    > From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
    > Sent: Friday, January 06, 2017 3:16 PM
    > To: Grandhi, Sainath <sainath.grandhi@intel.com>
    > Cc: netdev@vger.kernel.org; davem@davemloft.net;
    > mahesh@bandewar.net; linux-kernel@vger.kernel.org
    > Subject: Re: [PATCHv1 5/7] TAP: Extending tap device create/destroy APIs
    >
    > On Fri, 2017-01-06 at 14:33 -0800, Sainath Grandhi wrote:
    >
    > > +static int tap_list_add(dev_t major, const char *device_name) {
    > > + int err = 0;
    > > + struct major_info *tap_major;
    > > +
    > > + tap_major = kzalloc(sizeof(*tap_major), GFP_ATOMIC);
    > > +
    > > + tap_major->major = MAJOR(major);
    > > +
    >
    >
    > kzalloc() can perfectly return NULL.
    >
    > You do not want to crash it that happens.
    >
    Thanks for pointing out. Will send out next version that takes care of null pointer
    \
     
     \ /
      Last update: 2017-01-18 00:08    [W:2.530 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site