From 160915367c0e710e6868b647425957884f8adfa5 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 24 Jul 2019 23:08:49 +0000 Subject: [PATCH] Fix the fix to the logic bug. Upon further testing, the bug is that we shadoow opt.vendor with vendor. We shouldn't. Delete the latter and use the former everywhere and restore the prior logic which is now correct. --- sbin/nvmecontrol/logpage.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 82ad976eee72..a766a0bdaec5 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -403,7 +403,6 @@ logpage(const struct cmd *f, int argc, char *argv[]) char cname[64]; uint32_t nsid, size; void *buf; - const char *vendor = NULL; const struct logpage_function *lpf; struct nvme_controller_data cdata; print_fn_t print_fn; @@ -465,8 +464,8 @@ logpage(const struct cmd *f, int argc, char *argv[]) * unless the vendors match. */ SLIST_FOREACH(lpf, &logpages, link) { - if (lpf->vendor == NULL || vendor == NULL || - strcmp(lpf->vendor, vendor) != 0) + if (lpf->vendor != NULL && opt.vendor != NULL && + strcmp(lpf->vendor, opt.vendor) != 0) continue; if (opt.page != lpf->log_page) continue;