aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bluetooth/iwmbtfw/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c
index c2b67ce01906..9c899d374e92 100644
--- a/usr.sbin/bluetooth/iwmbtfw/main.c
+++ b/usr.sbin/bluetooth/iwmbtfw/main.c
@@ -518,6 +518,13 @@ main(int argc, char *argv[])
iwmbt_debug("firmware_path = %s", firmware_path);
+ /* Check firmware file exists before changing HW mode */
+ r = access(firmware_path, R_OK);
+ if (r) {
+ perror("Failed to open firmware");
+ goto shutdown;
+ }
+
/* Enter manufacturer mode */
r = iwmbt_enter_manufacturer(hdl);
if (r < 0) {