diff options
author | jimharris <jimharris@FreeBSD.org> | 2013-07-09 21:20:08 +0000 |
---|---|---|
committer | jimharris <jimharris@FreeBSD.org> | 2013-07-09 21:20:08 +0000 |
commit | cf34871a462ef3ef67391f4b2782cb0d51d2fe2c (patch) | |
tree | f638a27d52dba4f5bc2ae9e7ffc428d5f77c97c0 /sbin | |
parent | 7ed5b42834802b6170f1ef289f5ee704ff41c093 (diff) | |
download | FreeBSD-src-cf34871a462ef3ef67391f4b2782cb0d51d2fe2c.zip FreeBSD-src-cf34871a462ef3ef67391f4b2782cb0d51d2fe2c.tar.gz |
Try to read firmware image before prompting the user to confirm
firmware download. This correctly prints an error and exits for
an incorrect firmware image name before prompting the user to
confirm the download.
Sponsored by: Intel
MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/nvmecontrol/firmware.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/nvmecontrol/firmware.c b/sbin/nvmecontrol/firmware.c index c297f90..79adfb6 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -253,6 +253,9 @@ firmware(int argc, char *argv[]) "of available images\n", slot, controller); + if (f_flag) + read_image_file(image, &buf, &size); + if (f_flag && a_flag) printf("You are about to download and activate " "firmware image (%s) to controller %s.\n" @@ -282,7 +285,6 @@ firmware(int argc, char *argv[]) } if (f_flag) { - read_image_file(image, &buf, &size); update_firmware(fd, buf, size); if (a_flag) activate_firmware(fd, slot, |