From 7f34c97a798c2f5b9f7a9a526db279d7760bfa23 Mon Sep 17 00:00:00 2001 From: Zbigniew Bodek Date: Fri, 27 Nov 2015 18:13:28 +0000 Subject: [PATCH] Use properly aligned buffer in usb_alloc The PA adress must be gathered from an aligned VA, not the RAW pointer to the memory space. Reviewed by: hselasky Submitted by: Wojciech Macek Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4140 --- sys/boot/usb/usb_busdma_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/boot/usb/usb_busdma_loader.c b/sys/boot/usb/usb_busdma_loader.c index ad7180bc9e3..90dc1692ba0 100644 --- a/sys/boot/usb/usb_busdma_loader.c +++ b/sys/boot/usb/usb_busdma_loader.c @@ -233,7 +233,7 @@ usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg, pc->ismultiseg = (align == 1); /* compute physical address */ - usb_pc_common_mem_cb(pc, ptr, size); + usb_pc_common_mem_cb(pc, pc->buffer, size); usb_pc_cpu_flush(pc); return (0);