Skip to content

Commit 3c8ebca

Browse files
Michael HolzheuMartin Schwidefsky
authored andcommitted
[S390] hypfs: Fix error handling in hypfs_diag initialization
Fix the following two error handling bugs in hypfs_diag_init(): * No need for calling diag204_free_buffer() * Initialize name table only in case of LPAR and prevent error message on non-LPAR systems. Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 0b52783 commit 3c8ebca

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

‎arch/s390/hypfs/hypfs_diag.c‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -638,18 +638,21 @@ __init int hypfs_diag_init(void)
638638
pr_err("The hardware system does not support hypfs\n");
639639
return -ENODATA;
640640
}
641-
rc = diag224_get_name_table();
642-
if (rc) {
643-
diag204_free_buffer();
644-
pr_err("The hardware system does not provide all "
645-
"functions required by hypfs\n");
646-
}
647641
if (diag204_info_type == INFO_EXT) {
648642
rc = hypfs_dbfs_init();
649643
if (rc)
650-
diag204_free_buffer();
644+
return rc;
651645
}
652-
return rc;
646+
if (MACHINE_IS_LPAR) {
647+
rc = diag224_get_name_table();
648+
if (rc) {
649+
pr_err("The hardware system does not provide all "
650+
"functions required by hypfs\n");
651+
debugfs_remove(dbfs_d204_file);
652+
return rc;
653+
}
654+
}
655+
return 0;
653656
}
654657

655658
void hypfs_diag_exit(void)

0 commit comments

Comments
 (0)