Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1553499

Re: [PATCHv1 5/7] TAP: Extending tap device create/destroy APIs

From Eric Dumazet <eric.dumazet@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCHv1 5/7] TAP: Extending tap device create/destroy APIs
Date 2017-01-07 00:30 +0100
Message-ID <sWM7o-BR-45@gated-at.bofh.it> (permalink)
References <sWLkZ-8sx-5@gated-at.bofh.it> <sWLl0-8sx-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv1 0/7] Refactor macvtap to re-use tap functionality by other virtual intefaces Sainath Grandhi <sainath.grandhi@intel.com> - 2017-01-06 23:40 +0100
  [PATCHv1 6/7] TAP: tap as an independent module Sainath Grandhi <sainath.grandhi@intel.com> - 2017-01-06 23:40 +0100
    Re: [PATCHv1 6/7] TAP: tap as an independent module kbuild test robot <lkp@intel.com> - 2017-01-07 11:50 +0100
  [PATCHv1 5/7] TAP: Extending tap device create/destroy APIs Sainath Grandhi <sainath.grandhi@intel.com> - 2017-01-06 23:40 +0100
    Re: [PATCHv1 5/7] TAP: Extending tap device create/destroy APIs Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-01-07 00:30 +0100
    Re: [PATCHv1 5/7] TAP: Extending tap device create/destroy APIs Eric Dumazet <eric.dumazet@gmail.com> - 2017-01-07 00:30 +0100
  [PATCHv1 7/7] IPVTAP: IP-VLAN based tap driver Sainath Grandhi <sainath.grandhi@intel.com> - 2017-01-06 23:40 +0100
    Re: [PATCHv1 7/7] IPVTAP: IP-VLAN based tap driver Eric Dumazet <eric.dumazet@gmail.com> - 2017-01-07 00:20 +0100
    Re: [PATCHv1 7/7] IPVTAP: IP-VLAN based tap driver Mahesh Bandewar (महेश बंडेवार)          <maheshb@google.com> - 2017-01-07 00:50 +0100
  [PATCHv1 2/7] TAP: Renaming tap related APIs, data structures,  macros Sainath Grandhi <sainath.grandhi@intel.com> - 2017-01-06 23:40 +0100
    Re: [PATCHv1 2/7] TAP: Renaming tap related APIs, data structures,  macros kbuild test robot <lkp@intel.com> - 2017-01-07 11:40 +0100
  [PATCHv1 3/7] TAP: Tap character device creation/destroy API Sainath Grandhi <sainath.grandhi@intel.com> - 2017-01-06 23:40 +0100
  [PATCHv1 4/7] TAP: Abstract type of virtual interface from tap implementation Sainath Grandhi <sainath.grandhi@intel.com> - 2017-01-06 23:40 +0100
  Re: [PATCHv1 1/7] TAP: Refactoring macvtap.c Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-01-07 00:20 +0100

csiph-web