https://github.com/torvalds/linux
Revision 8623ccbfc55d962e19a3537652803676ad7acb90 authored by Yang Yingliang on 10 November 2022, 15:19:17 UTC, committed by Jon Mason on 08 July 2023, 14:51:55 UTC
If device_register() returns error, the name allocated by
dev_set_name() need be freed. As comment of device_register()
says, it should use put_device() to give up the reference in
the error path. So fix this by calling put_device(), then the
name can be freed in kobject_cleanup(), and client_dev is freed
in ntb_transport_client_release().

Fixes: fce8a7bb5b4b ("PCI-Express Non-Transparent Bridge Support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
1 parent 4c3c796
History
Tip revision: 8623ccbfc55d962e19a3537652803676ad7acb90 authored by Yang Yingliang on 10 November 2022, 15:19:17 UTC
NTB: ntb_transport: fix possible memory leak while device_register() fails
Tip revision: 8623ccb
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