]> git.baikalelectronics.ru Git - kernel.git/commit
USB: apple-mfi-fastcharge: fix reference leak in apple_mfi_fc_set_property
authorZhang Qilong <zhangqilong3@huawei.com>
Mon, 2 Nov 2020 02:26:50 +0000 (10:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2020 11:06:58 +0000 (12:06 +0100)
commit159562301b2e3e658721d9baddce9a73ecab64a4
treecacda820f2c7a5f09858a4df7dacc35a62e01cb3
parentae73a64125ed9cc2f4bfce233e282753da4e4d7b
USB: apple-mfi-fastcharge: fix reference leak in apple_mfi_fc_set_property

pm_runtime_get_sync() will increment pm usage at first and it
will resume the device later. If runtime of the device has
error or device is in inaccessible state(or other error state),
resume operation will fail. If we do not call put operation to
decrease the reference, the result is that this device cannot
enter the idle state and always stay busy or other non-idle
state.

Fixes: 82cf1daeb1d58 ("USB: Add driver to control USB fast charge for iOS devices")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201102022650.67115-1-zhangqilong3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/apple-mfi-fastcharge.c