lkml.org 
[lkml]   [2017]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCHv1 5/7] TAP: Extending tap device create/destroy APIs
From
Date
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.


\
 
 \ /
  Last update: 2017-01-07 00:25    [W:0.111 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site