commit | 986d3a6545e501d5f92c529702bad0fa5dc46d1b | [log] [tgz] |
---|---|---|
author | William A. Kennington III <wak@google.com> | Thu Mar 31 17:58:30 2022 -0700 |
committer | William A. Kennington III <wak@google.com> | Fri Apr 01 16:17:04 2022 +0000 |
tree | c13bb6c43d12904f02841df996e4e9cec640d464 | |
parent | 93f35f05e6670ce4d35dce29fa524475f1fccc36 [diff] |
meta-google: google-usb-network: Cleanup gadget if setup fails If setup fails for any reason, we want to cleanup any of the gadget functions that were created. Change-Id: I61be13a66cba2916fe7685b021fe0f7fa225e4f6 Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/networking/google-usb-network/usb_network.sh b/meta-google/recipes-google/networking/google-usb-network/usb_network.sh index 6f2c4d5..3c38fb4 100755 --- a/meta-google/recipes-google/networking/google-usb-network/usb_network.sh +++ b/meta-google/recipes-google/networking/google-usb-network/usb_network.sh
@@ -185,5 +185,8 @@ if [[ $ACTION == "stop" ]]; then gadget_stop else - gadget_start + rc=0 + gadget_start || rc=$? + (( rc == 0 )) || gadget_stop || true + exit $rc fi