lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 20 May 2020 13:44:10 +0200
From:   Bartosz Golaszewski <>
To:     Jonathan Corbet <>,
        "David S . Miller" <>,
        Matthias Brugger <>,
        John Crispin <>,
        Sean Wang <>,
        Mark Lee <>,
        Jakub Kicinski <>,
        Arnd Bergmann <>,
        Fabien Parent <>,
        Heiner Kallweit <>,
        Edwin Peer <>
        Stephane Le Provost <>,
        Pedro Tsai <>,
        Andrew Perepech <>,
        Bartosz Golaszewski <>
Subject: [PATCH 0/5] net: provide a devres variant of register_netdev()

From: Bartosz Golaszewski <>

This series applies on top of my mtk-eth-mac series[1].

Using devres helpers allows to shrink the probing code, avoid memory leaks in
error paths make sure the order in which resources are freed is the exact
opposite of their allocation. This series proposes to add a devres variant
of register_netdev() that will only work with net_device structures whose
memory is also managed.

First we add the missing documentation entry for the only other networking
devres helper: devm_alloc_etherdev().

Next we move devm_alloc_etherdev() into a separate source file.

We then use a proxy structure in devm_alloc_etherdev() to improve readability.

Last: we implement devm_register_netdev() and use it in mtk-eth-mac driver.


Bartosz Golaszewski (5):
  Documentation: devres: add a missing section for networking helpers
  net: move devres helpers into a separate source file
  net: devres: define a separate devres structure for
  net: devres: provide devm_register_netdev()
  net: ethernet: mtk_eth_mac: use devm_register_netdev()

 .../driver-api/driver-model/devres.rst        |  5 +
 drivers/net/ethernet/mediatek/mtk_eth_mac.c   | 17 +---
 include/linux/netdevice.h                     |  2 +
 net/Makefile                                  |  2 +-
 net/devres.c                                  | 95 +++++++++++++++++++
 net/ethernet/eth.c                            | 28 ------
 6 files changed, 104 insertions(+), 45 deletions(-)
 create mode 100644 net/devres.c


Powered by blists - more mailing lists