diff options
author | jimharris <jimharris@FreeBSD.org> | 2013-07-17 23:14:41 +0000 |
---|---|---|
committer | jimharris <jimharris@FreeBSD.org> | 2013-07-17 23:14:41 +0000 |
commit | 6ded7d8bc2691570cfdd7fc32187f20214d14279 (patch) | |
tree | ed4a407b7acad67c5251cffac061fc3f57ec426a /sbin | |
parent | 67afca3d1252e098f32a7c89938546e20ae00a3c (diff) | |
download | FreeBSD-src-6ded7d8bc2691570cfdd7fc32187f20214d14279.zip FreeBSD-src-6ded7d8bc2691570cfdd7fc32187f20214d14279.tar.gz |
Always initialize fd to 0 in open_dev().
Sponsored by: Intel
Reviewed by: carl
MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/nvmecontrol/nvmecontrol.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/nvmecontrol/nvmecontrol.c b/sbin/nvmecontrol/nvmecontrol.c index 63cec3c..826195d 100644 --- a/sbin/nvmecontrol/nvmecontrol.c +++ b/sbin/nvmecontrol/nvmecontrol.c @@ -166,6 +166,8 @@ open_dev(const char *str, int *fd, int show_error, int exit_on_error) struct stat devstat; char full_path[64]; + *fd = 0; + if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) { if (show_error) warnx("controller/namespace ids must begin with '%s'", |