net: vlan: avoid leaks on register_vlan_dev() failures
Jakub Kicinski authored
[ Upstream commit 55b7ab11 ]

VLAN checks for NETREG_UNINITIALIZED to distinguish between
registration failure and unregistration in progress.

Since commit cb626bf5 ("net-sysfs: Fix reference count leak")
registration failure may, however, result in NETREG_UNREGISTERED
as well as NETREG_UNINITIALIZED.

This fix is similer to cebb6975 ("rtnetlink: Fix
memory(net_device) leak when ->newlink fails")

Fixes: cb626bf5

 ("net-sysfs: Fix reference count leak")
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
78f33b3e
Name Last commit Last update
Documentation USB: UAS: introduce a quirk to set no_write_same
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text
arch KVM: x86: fix shift out of bounds reported by UBSAN
block block: factor out requeue handling from dispatch code
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
crypto crypto: ecdh - avoid buffer overflow in ecdh_set_secret()
drivers net: stmmac: dwmac-sun8i: Balance internal PHY power
firmware Fix built-in early-load Intel microcode alignment
fs btrfs: send: fix wrong file path when there is an inode with a pending rmdir
include net: sched: prevent invalid Scell_log shift count
init printk: reduce LOG_BUF_SHIFT range for H8300
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index
kernel workqueue: Kick a worker based on the actual activation of delayed works
lib lib/genalloc: fix the overflow when size is too big
mm mm/swapfile: do not sleep with a spin lock held
net net: vlan: avoid leaks on register_vlan_dev() failures
samples samples: bpf: Fix lwt_len_hist reusing previous BPF map
scripts depmod: handle the case of /sbin/depmod without /sbin in PATH
security ima: Don't modify file descriptor mode on the fly
sound ALSA: hda/realtek - Fix speaker volume control on Lenovo C940
tools perf record: Fix memory leak when using '--user-regs=?' to list registers
usr initramfs: restore default compression behavior
virt KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace
.clang-format clang-format: Set IndentWrappedFunctionNames false
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore Merge tag 'kbuild-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
.mailmap Merge tag 'libnvdimm-for-4.19_misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm
COPYING COPYING: use the new text with points to the license files
CREDITS 9p: remove Ron Minnich from MAINTAINERS
Kbuild Merge tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt
MAINTAINERS Documentation/llvm: add documentation on building w/ Clang/LLVM
Makefile Linux 4.19.167
README Docs: Added a pointer to the formatted docs to README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.