usb: misc: eud: Fix an error handling path in eud_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 3 Apr 2022 09:59:15 +0000 (11:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Apr 2022 17:24:10 +0000 (19:24 +0200)
commit929b22e669b15fc9a2ab110ea27f0c489ed92beb
treeacf9d92669823083bfa0381d5f159ffa35c8fdf1
parent0543e4e8852ef5ff1809ae62f1ea963e2ab23b66
usb: misc: eud: Fix an error handling path in eud_probe()

It is odd to call devm_add_action_or_reset() before calling the function
that should be undone.

Either, the "_or_reset" part should be omitted, or the action should be
recorded after the resources have been allocated.

Switch the order of devm_add_action_or_reset() and usb_role_switch_get().

Fixes: 9a1bf58ccd44 ("usb: misc: eud: Add driver support for Embedded USB Debugger(EUD)")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/362908699275ecec078381b42d87c817c6965fc6.1648979948.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/qcom_eud.c