From f046ed24a393a7379fea8dced9f52fc83f3c6803 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Fri, 18 Mar 2022 10:57:38 +0000 Subject: [PATCH] Remove duplicate stop command in hackrf_close(). --- host/libhackrf/src/hackrf.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/host/libhackrf/src/hackrf.c b/host/libhackrf/src/hackrf.c index b5c1554e..517c6a79 100644 --- a/host/libhackrf/src/hackrf.c +++ b/host/libhackrf/src/hackrf.c @@ -1947,22 +1947,20 @@ int ADDCALL hackrf_stop_tx(hackrf_device* device) int ADDCALL hackrf_close(hackrf_device* device) { - int result1, result2, result3; + int result1, result2; result1 = HACKRF_SUCCESS; result2 = HACKRF_SUCCESS; - result3 = HACKRF_SUCCESS; if( device != NULL ) { result1 = hackrf_stop_cmd(device); - result2 = hackrf_stop_cmd(device); /* * Finally kill the transfer thread, which will * also cancel any pending transmit/receive transfers. */ - result3 = kill_transfer_thread(device); + result2 = kill_transfer_thread(device); if( device->usb_device != NULL ) { libusb_release_interface(device->usb_device, 0); @@ -1980,10 +1978,6 @@ int ADDCALL hackrf_close(hackrf_device* device) } open_devices--; - if (result3 != HACKRF_SUCCESS) - { - return result3; - } if (result2 != HACKRF_SUCCESS) { return result2;