diff options
| author | Sumanth Korikkar <sumanthk@linux.ibm.com> | 2026-08-11 16:23:06 +0200 |
|---|---|---|
| committer | Heiko Carstens <hca@linux.ibm.com> | 2026-08-31 16:25:39 +0200 |
| commit | 439077c39d8f7108aea4dd8d4d819b9b864fe84c (patch) | |
| tree | 7bd66a168cb603322082ceed1b4790d44fd1446b /arch | |
| parent | a91a5c25a2c3f652178b591facc2395a7dbb59af (diff) | |
| download | linux-next-439077c39d8f7108aea4dd8d4d819b9b864fe84c.tar.gz linux-next-439077c39d8f7108aea4dd8d4d819b9b864fe84c.zip | |
s390/diag324: Preserve -EBUSY return code
When diag324 reports -EBUSY, the error code is
overwritten by the result of copy_to_user() and put_user(). As a result,
the ioctl may incorrectly return success instead of -EBUSY.
Preserve the original diag324 return code and only return -EFAULT when
copying data to userspace fails.
Fixes: 90e6f191e1ee ("s390/diag324: Retrieve power readings via diag 0x324")
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/s390/kernel/diag/diag324.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/s390/kernel/diag/diag324.c b/arch/s390/kernel/diag/diag324.c index fe325c2a2d0d..3eec0cc8fb9e 100644 --- a/arch/s390/kernel/diag/diag324.c +++ b/arch/s390/kernel/diag/diag324.c @@ -182,8 +182,7 @@ long diag324_pibbuf(unsigned long arg) goto out; rc = copy_to_user((void __user *)address, data->pib, data->pib->len); rc |= put_user(data->sequence, &udata->sequence); - if (rc) - rc = -EFAULT; + rc = rc ? -EFAULT : data->rc; out: mutex_unlock(&pibmutex); return rc; |
