diff options
author | Mete Durlu <meted@linux.ibm.com> | 2024-07-04 14:10:05 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2024-07-10 19:50:44 +0200 |
commit | bb9be93acb7e6a0fa78919d30e68410c401fe690 (patch) | |
tree | 197f901ba583307b3975d5387ca690996a74954a | |
parent | 7455a33179e65267cd7c8910050b6f0be3ff6b83 (diff) |
s390/diag: Return errno's from diag204
Return different errno's from diag204 to allow users to handle them
accordingly. Instead of returning -1 regardless of the failing
condition, return -EINVAL on invalid memory address and -EOPNOTSUPP when
diag instruction fails.
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Tobias Huschle <huschle@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-rw-r--r-- | arch/s390/kernel/diag.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c index 8dee9aa0ec95b..9f33dcecbffab 100644 --- a/arch/s390/kernel/diag.c +++ b/arch/s390/kernel/diag.c @@ -215,16 +215,16 @@ int diag204(unsigned long subcode, unsigned long size, void *addr) { if (addr) { if (WARN_ON_ONCE(!is_vmalloc_addr(addr))) - return -1; + return -EINVAL; if (WARN_ON_ONCE(!IS_ALIGNED((unsigned long)addr, PAGE_SIZE))) - return -1; + return -EINVAL; } if ((subcode & DIAG204_SUBCODE_MASK) == DIAG204_SUBC_STIB4) addr = (void *)pfn_to_phys(vmalloc_to_pfn(addr)); diag_stat_inc(DIAG_STAT_X204); size = __diag204(&subcode, size, addr); if (subcode) - return -1; + return -EOPNOTSUPP; return size; } EXPORT_SYMBOL(diag204); |