]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
s390/vmur: fix virtual vs physical address confusion
authorThomas Richter <tmricht@linux.ibm.com>
Thu, 25 Jan 2024 09:48:57 +0000 (10:48 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 9 Feb 2024 12:58:14 +0000 (13:58 +0100)
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>
drivers/s390/char/vmur.c

index 82efdd20ad01edebfc554e98b7af64c9e33a2b46..1d17a83569ce436ca37718dad31150cbd41df47a 100644 (file)
@@ -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);