diff options
author | Thomas Richter <tmricht@linux.ibm.com> | 2024-01-25 10:48:57 +0100 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2024-02-09 13:58:14 +0100 |
commit | 0ad92cbd5a55df4cf4610a9124b24e3f74b1ac50 (patch) | |
tree | c2ccd76dfbfe2ffbad791caa5376df6871f1d4e6 /drivers/s390/char/vmur.c | |
parent | s390/time: improve steering precision (diff) | |
download | linux-0ad92cbd5a55df4cf4610a9124b24e3f74b1ac50.tar.xz linux-0ad92cbd5a55df4cf4610a9124b24e3f74b1ac50.zip |
s390/vmur: fix virtual vs physical address confusion
Add missing virt_to_phys() / phys_to_virt() translation to
alloc_chan_prog() and free_chan_prog().
This doesn't fix a bug since virtual and physical addresses
are currently the same.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers/s390/char/vmur.c')
-rw-r--r-- | drivers/s390/char/vmur.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index 82efdd20ad01..1d17a83569ce 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c @@ -195,7 +195,7 @@ static void free_chan_prog(struct ccw1 *cpa) struct ccw1 *ptr = cpa; while (ptr->cda) { - kfree((void *)(addr_t) ptr->cda); + kfree(phys_to_virt(ptr->cda)); ptr++; } kfree(cpa); @@ -237,7 +237,7 @@ static struct ccw1 *alloc_chan_prog(const char __user *ubuf, int rec_count, free_chan_prog(cpa); return ERR_PTR(-ENOMEM); } - cpa[i].cda = (u32)(addr_t) kbuf; + cpa[i].cda = (u32)virt_to_phys(kbuf); if (copy_from_user(kbuf, ubuf, reclen)) { free_chan_prog(cpa); return ERR_PTR(-EFAULT); |