https://github.com/torvalds/linux
Revision 956578e3d397e00d6254dc7b5194d28587f98518 authored by ruanjinjie on 09 November 2022, 09:28:52 UTC, committed by Jon Mason on 08 July 2023, 15:02:36 UTC
As ntb_register_device() don't handle error of device_register(),
if ntb_register_device() returns error in pci_vntb_probe(), name of kobject
which is allocated in dev_set_name() called in device_add() is leaked.

As comment of device_add() says, it should call put_device() to drop the
reference count that was set in device_initialize()
when it fails, so the name can be freed in kobject_cleanup().

Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
1 parent 2790143
History
Tip revision: 956578e3d397e00d6254dc7b5194d28587f98518 authored by ruanjinjie on 09 November 2022, 09:28:52 UTC
NTB: EPF: fix possible memory leak in pci_vntb_probe()
Tip revision: 956578e
File Mode Size
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
include
init
io_uring
ipc
kernel
lib
mm
net
rust
samples
scripts
security
sound
tools
usr
virt
.clang-format -rw-r--r-- 20.1 KB
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 151 bytes
.gitattributes -rw-r--r-- 90 bytes
.gitignore -rw-r--r-- 2.1 KB
.mailmap -rw-r--r-- 28.1 KB
.rustfmt.toml -rw-r--r-- 369 bytes
COPYING -rw-r--r-- 496 bytes
CREDITS -rw-r--r-- 100.1 KB
Kbuild -rw-r--r-- 2.5 KB
Kconfig -rw-r--r-- 555 bytes
MAINTAINERS -rw-r--r-- 694.3 KB
Makefile -rw-r--r-- 70.1 KB
README -rw-r--r-- 727 bytes

README

back to top