summaryrefslogtreecommitdiffstats
path: root/kernel/dma/direct.c
diff options
context:
space:
mode:
authorakpm <akpm@linux-foundation.org>2022-06-27 19:31:34 +0200
committerakpm <akpm@linux-foundation.org>2022-06-27 19:31:34 +0200
commit46a3b1125308f8f90a065eeecfafd2a96b01a36c (patch)
tree6e080118fbad5aa217d160cedf02f10108ce3bf2 /kernel/dma/direct.c
parentmm/kmemleak: prevent soft lockup in first object iteration loop of kmemleak_s... (diff)
parentLinux 5.19-rc4 (diff)
downloadlinux-46a3b1125308f8f90a065eeecfafd2a96b01a36c.tar.xz
linux-46a3b1125308f8f90a065eeecfafd2a96b01a36c.zip
Merge branch 'master' into mm-stable
Diffstat (limited to 'kernel/dma/direct.c')
-rw-r--r--kernel/dma/direct.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index e978f36e6be8..8d0b68a17042 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -357,7 +357,7 @@ void dma_direct_free(struct device *dev, size_t size,
} else {
if (IS_ENABLED(CONFIG_ARCH_HAS_DMA_CLEAR_UNCACHED))
arch_dma_clear_uncached(cpu_addr, size);
- if (dma_set_encrypted(dev, cpu_addr, 1 << page_order))
+ if (dma_set_encrypted(dev, cpu_addr, size))
return;
}
@@ -392,7 +392,6 @@ void dma_direct_free_pages(struct device *dev, size_t size,
struct page *page, dma_addr_t dma_addr,
enum dma_data_direction dir)
{
- unsigned int page_order = get_order(size);
void *vaddr = page_address(page);
/* If cpu_addr is not from an atomic pool, dma_free_from_pool() fails */
@@ -400,7 +399,7 @@ void dma_direct_free_pages(struct device *dev, size_t size,
dma_free_from_pool(dev, vaddr, size))
return;
- if (dma_set_encrypted(dev, vaddr, 1 << page_order))
+ if (dma_set_encrypted(dev, vaddr, size))
return;
__dma_direct_free_pages(dev, page, size);
}