Skip to content

Commit f4edb5c

Browse files
committed
parisc: Fix iodc and device path return values on old machines
Older machines may not fully initialize the return values when asking for IODC and device path data when building the inventory. Work around possible firmware leaks by proper initialization of the variables. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 44ac7f5 commit f4edb5c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/parisc/kernel/drivers.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data)
995995
struct pdc_system_map_mod_info pdc_mod_info;
996996
struct pdc_module_path mod_path;
997997

998+
memset(&iodc_data, 0, sizeof(iodc_data));
998999
status = pdc_iodc_read(&count, hpa, 0,
9991000
&iodc_data, sizeof(iodc_data));
10001001
if (status != PDC_OK) {
@@ -1012,6 +1013,11 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data)
10121013

10131014
mod_index = 0;
10141015
do {
1016+
/* initialize device path for old machines */
1017+
memset(&mod_path, 0xff, sizeof(mod_path));
1018+
get_node_path(dev->dev.parent, &mod_path.path);
1019+
mod_path.path.mod = dev->hw_path;
1020+
memset(&pdc_mod_info, 0, sizeof(pdc_mod_info));
10151021
status = pdc_system_map_find_mods(&pdc_mod_info,
10161022
&mod_path, mod_index++);
10171023
} while (status == PDC_OK && pdc_mod_info.mod_addr != hpa);

0 commit comments

Comments
 (0)