]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: musb: Fix runtime PM imbalance on error
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Mon, 25 May 2020 02:50:49 +0000 (21:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jun 2020 07:23:00 +0000 (09:23 +0200)
commit234257c8709f8757b1a1092cdc4bd04f3a9f864f
tree94bdf81b7cf6be1901ba90707f5443db2f0a58ff
parent20797d67c68af026ef1e4d0dfcc003d965faa314
usb: musb: Fix runtime PM imbalance on error

commit e4befc121df03dc8ed2ac1031c98f9538e244bae upstream.

When copy_from_user() returns an error code, there
is a runtime PM usage counter imbalance.

Fix this by moving copy_from_user() to the beginning
of this function.

Fixes: 7b6c1b4c0e1e ("usb: musb: fix runtime PM in debugfs")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Bin Liu <b-liu@ti.com>
Link: https://lore.kernel.org/r/20200525025049.3400-7-b-liu@ti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_debugfs.c