Always initialize fd to 0 in open_dev().

Sponsored by:	Intel
Reviewed by:	carl
MFC after:	3 days
This commit is contained in:
Jim Harris 2013-07-17 23:14:41 +00:00
parent a073133cdf
commit a648fac32d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253436

View File

@ -166,6 +166,8 @@ open_dev(const char *str, int *fd, int show_error, int exit_on_error)
struct stat devstat; struct stat devstat;
char full_path[64]; char full_path[64];
*fd = 0;
if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) { if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) {
if (show_error) if (show_error)
warnx("controller/namespace ids must begin with '%s'", warnx("controller/namespace ids must begin with '%s'",