Skip to content

Commit bb9be93

Browse files
NickJackolsonVasily Gorbik
authored andcommitted
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 <[email protected]> Reviewed-by: Tobias Huschle <[email protected]> Signed-off-by: Mete Durlu <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 7455a33 commit bb9be93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/s390/kernel/diag.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,16 @@ int diag204(unsigned long subcode, unsigned long size, void *addr)
215215
{
216216
if (addr) {
217217
if (WARN_ON_ONCE(!is_vmalloc_addr(addr)))
218-
return -1;
218+
return -EINVAL;
219219
if (WARN_ON_ONCE(!IS_ALIGNED((unsigned long)addr, PAGE_SIZE)))
220-
return -1;
220+
return -EINVAL;
221221
}
222222
if ((subcode & DIAG204_SUBCODE_MASK) == DIAG204_SUBC_STIB4)
223223
addr = (void *)pfn_to_phys(vmalloc_to_pfn(addr));
224224
diag_stat_inc(DIAG_STAT_X204);
225225
size = __diag204(&subcode, size, addr);
226226
if (subcode)
227-
return -1;
227+
return -EOPNOTSUPP;
228228
return size;
229229
}
230230
EXPORT_SYMBOL(diag204);

0 commit comments

Comments
 (0)