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.
This commit is contained in:
Warner Losh 2019-07-24 23:08:49 +00:00
parent 2fb62b1a46
commit 160915367c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350311

View File

@ -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;