nfit_test: fix security state pull for nvdimm security nfit_test
authorDave Jiang <dave.jiang@intel.com>
Tue, 15 Jan 2019 01:41:04 +0000 (18:41 -0700)
committerDan Williams <dan.j.williams@intel.com>
Mon, 21 Jan 2019 17:56:29 +0000 (09:56 -0800)
The override status function needs to be updated to use the proper
request parameter in order to get the security state.

Fixes: 3c13e2ac747a ("...Add test support for Intel nvdimm security DSMs")
Reported-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
tools/testing/nvdimm/dimm_devs.c

index e752384..2d4baf5 100644 (file)
@@ -18,8 +18,8 @@ ssize_t security_show(struct device *dev,
         * For the test version we need to poll the "hardware" in order
         * to get the updated status for unlock testing.
         */
-       nvdimm->sec.state = nvdimm_security_state(nvdimm, false);
-       nvdimm->sec.ext_state = nvdimm_security_state(nvdimm, true);
+       nvdimm->sec.state = nvdimm_security_state(nvdimm, NVDIMM_USER);
+       nvdimm->sec.ext_state = nvdimm_security_state(nvdimm, NVDIMM_MASTER);
 
        switch (nvdimm->sec.state) {
        case NVDIMM_SECURITY_DISABLED: