]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
firmware: Fix a reference count leak.
authorQiushi Wu <wu000273@umn.edu>
Sat, 13 Jun 2020 19:05:33 +0000 (14:05 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 29 Jul 2020 17:13:50 +0000 (13:13 -0400)
commitfe3c60684377d5ad9b0569b87ed3e26e12c8173b
tree2cc428956b90a91a15ff8d4c09ee523a6bdcb591
parent92ed301919932f777713b9172e525674157e983d
firmware: Fix a reference count leak.

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: Qiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200613190533.15712-1-wu000273@umn.edu
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/firmware/qemu_fw_cfg.c