From ed25e2a520ccb2a8aae034577bb7a18d1a4ef0dc Mon Sep 17 00:00:00 2001 From: Wen Xiong Date: Wed, 23 Jul 2014 15:55:16 -0500 Subject: [PATCH] iprutils: on PowerNV, some of IOAs showed the wrong physical location With iprutils 2.4.2 in PowerNV system, sometime some of IOAs still showed the wrong phyiscal location. This patch fixes the issue. signed-off-by: Wen Xiong --- iprlib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iprlib.c b/iprlib.c index 418bfdc..1220d61 100644 --- a/iprlib.c +++ b/iprlib.c @@ -1940,6 +1940,7 @@ static void ipr_get_pci_slots() ioa->physical_location[0] = '\0'; for_each_ioa(ioa) { + memset(devspec, 0, sizeof(devspec)); sprintf(attr, "/sys/bus/pci/devices/%s/devspec", ioa->pci_address); rc = read_attr_file(attr, devspec, PATH_MAX); @@ -1947,6 +1948,7 @@ static void ipr_get_pci_slots() if (rc) continue; + memset(loc_code, 0, sizeof(loc_code)); sprintf(locpath, "/proc/device-tree%s/ibm,loc-code", devspec); rc = read_attr_file(locpath, loc_code,