summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2013-07-17 23:14:41 +0000
committerjimharris <jimharris@FreeBSD.org>2013-07-17 23:14:41 +0000
commit6ded7d8bc2691570cfdd7fc32187f20214d14279 (patch)
treeed4a407b7acad67c5251cffac061fc3f57ec426a /sbin
parent67afca3d1252e098f32a7c89938546e20ae00a3c (diff)
downloadFreeBSD-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.c2
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'",
OpenPOWER on IntegriCloud