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>
Mon, 25 May 2020 11:36:31 +0000 (13:36 +0200)
commite4befc121df03dc8ed2ac1031c98f9538e244bae
tree595552c47681f945812c324b28a3ed2d61cb0dde
parent685f5f24108a5f3481da70ee75a1b18b9de34257
usb: musb: Fix runtime PM imbalance on error

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>
drivers/usb/musb/musb_debugfs.c