forked from Minki/linux
e3436ce60c
gasket_sysfs_register_store() invokes get_mapping(), which returns a reference of the specified gasket_sysfs_mapping object to "mapping" with increased refcnt. When gasket_sysfs_register_store() returns, local variable "mapping" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of gasket_sysfs_register_store(). When gasket_dev is NULL, the function forgets to decrease the refcnt increased by get_mapping(), causing a refcnt leak. Fix this issue by calling put_mapping() when gasket_dev is NULL. Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Link: https://lore.kernel.org/r/1587618941-13718-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
||
---|---|---|
.. | ||
apex_driver.c | ||
apex.h | ||
gasket_constants.h | ||
gasket_core.c | ||
gasket_core.h | ||
gasket_interrupt.c | ||
gasket_interrupt.h | ||
gasket_ioctl.c | ||
gasket_ioctl.h | ||
gasket_page_table.c | ||
gasket_page_table.h | ||
gasket_sysfs.c | ||
gasket_sysfs.h | ||
gasket.h | ||
Kconfig | ||
Makefile | ||
TODO |