summaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-12-07 19:33:33 +0300
committerArd Biesheuvel <ardb@kernel.org>2020-12-07 21:31:43 +0300
commit91c1c092f27da4164d55ca81e0a483108f8a3235 (patch)
tree38f2f5ffc9240d401ac60e34d5c9b56cfdc8a5c7 /drivers/firmware
parentb283477d394ac41ca59ee20eb9293ae9002eb1d7 (diff)
downloadlinux-91c1c092f27da4164d55ca81e0a483108f8a3235.tar.xz
efi: capsule: use atomic kmap for transient sglist mappings
Don't use the heavy-weight kmap() API to create short-lived mappings of the scatter-gather list entries that are released as soon as the entries are written. Instead, use kmap_atomic(), which is more suited to this purpose. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/capsule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firmware/efi/capsule.c b/drivers/firmware/efi/capsule.c
index 598b7800d14e..43f6fe7bfe80 100644
--- a/drivers/firmware/efi/capsule.c
+++ b/drivers/firmware/efi/capsule.c
@@ -244,7 +244,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages)
for (i = 0; i < sg_count; i++) {
efi_capsule_block_desc_t *sglist;
- sglist = kmap(sg_pages[i]);
+ sglist = kmap_atomic(sg_pages[i]);
for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) {
u64 sz = min_t(u64, imagesize,
@@ -265,7 +265,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages)
else
sglist[j].data = page_to_phys(sg_pages[i + 1]);
- kunmap(sg_pages[i]);
+ kunmap_atomic(sglist);
}
mutex_lock(&capsule_mutex);