summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2013-11-19 15:40:41 -0800
committerNicholas Corgan <nick.corgan@ettus.com>2013-11-19 15:40:41 -0800
commit60108e3ca8fdab91d9e0e133c96f3e06916ac934 (patch)
treecb4e3a3c56803e157d7aa3ccf6232f73eae524d5 /host
parenta764d4b3bfd2165b34fb1bf46bc739587e479600 (diff)
downloaduhd-60108e3ca8fdab91d9e0e133c96f3e06916ac934.tar.gz
uhd-60108e3ca8fdab91d9e0e133c96f3e06916ac934.tar.bz2
uhd-60108e3ca8fdab91d9e0e133c96f3e06916ac934.zip
b2xx_fx3_utils: more validation before trying to load
Diffstat (limited to 'host')
-rw-r--r--host/utils/b2xx_fx3_utils.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp
index 01e1ea793..c182548b7 100644
--- a/host/utils/b2xx_fx3_utils.cpp
+++ b/host/utils/b2xx_fx3_utils.cpp
@@ -264,6 +264,16 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) {
if (fw_file.empty())
fw_file = uhd::find_image_path(B200_FW_FILE_NAME);
+
+ if(fw_file.empty()) {
+ std::cerr << "Firmware image not found!" << std::endl;
+ return -1;
+ }
+
+ if(!(fs::exists(fw_file))) {
+ std::cerr << "Invalid filepath: " << fw_file << std::endl;
+ return -1;
+ }
// load firmware
b200->load_firmware(fw_file);