Skip to content
Snippets Groups Projects
Commit 2c7e1495 authored by Qiushi Wu's avatar Qiushi Wu Committed by Yang Yingliang
Browse files

firmware: Fix a reference count leak.


stable inclusion
from linux-4.19.139
commit 937dafe8682044e70821c886d9063869744b3057

--------------------------------

[ Upstream commit fe3c6068 ]

kobject_init_and_add() takes reference even when it fails.
If this function returns an error, kobject_put() must be called to
properly clean up the memory associated with the object.
Callback function fw_cfg_sysfs_release_entry() in kobject_put()
can handle the pointer "entry" properly.

Signed-off-by: default avatarQiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200613190533.15712-1-wu000273@umn.edu


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 126a0166
No related branches found
No related tags found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment