diff options
author | Kevin Hilman <khilman@linaro.org> | 2015-12-10 07:23:15 -0800 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-12-10 07:23:15 -0800 |
commit | c228c8e94b9e56032d475abc8f5978a73ac3f699 (patch) | |
tree | a3045c46c383f00d3fd7bcefee16c10c68643953 /arch/arm/mm/dma-mapping.c | |
parent | 1388239cd22fcaf1572a12197faa14a63d45aa27 (diff) | |
parent | 5d7b0fcc26d66db767a477574effc764022c19ac (diff) |
Merge tag 'v3.14.58' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-linaro-lsk-v3.14lsk-v3.14-16.01lsk-v3.14-15.12
This is the 3.14.58 stable release
# gpg: Signature made Wed Dec 9 10:43:44 2015 PST using RSA key ID 6092693E
# gpg: Good signature from "Greg Kroah-Hartman (Linux kernel stable release signing key) <greg@kroah.com>"
* tag 'v3.14.58' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (38 commits)
Linux 3.14.58
ALSA: usb-audio: work around CH345 input SysEx corruption
ALSA: usb-audio: prevent CH345 multiport output SysEx corruption
ALSA: usb-audio: add packet size quirk for the Medeli DD305
USB: option: add XS Stick W100-2 from 4G Systems
USB: serial: option: add support for Novatel MiFi USB620L
USB: ti_usb_3410_5052: Add Honeywell HGI80 ID
usb: musb: core: fix order of arguments to ulpi write callback
usblp: do not set TASK_INTERRUPTIBLE before lock
arm64: Fix compat register mappings
can: sja1000: clear interrupts on start
Bluetooth: ath3k: Add support of AR3012 0cf3:817b device
Bluetooth: ath3k: Add new AR3012 0930:021c id
Bluetooth: hidp: fix device disconnect on idle timeout
staging: rtl8712: Add device ID for Sitecom WLA2100
mwifiex: fix mwifiex_rdeeprom_read()
net: mvneta: Fix CPU_MAP registers initialisation
mac80211: fix driver RSSI event calculations
x86/cpu: Fix SMAP check in PVOPS environments
x86/cpu: Call verify_cpu() after having entered long mode too
...
Diffstat (limited to 'arch/arm/mm/dma-mapping.c')
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 42f2fb8c5a00..887b19e915ee 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1411,12 +1411,19 @@ static int arm_iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma, unsigned long uaddr = vma->vm_start; unsigned long usize = vma->vm_end - vma->vm_start; struct page **pages = __iommu_get_pages(cpu_addr, attrs); + unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; + unsigned long off = vma->vm_pgoff; vma->vm_page_prot = __get_dma_pgprot(attrs, vma->vm_page_prot); if (!pages) return -ENXIO; + if (off >= nr_pages || (usize >> PAGE_SHIFT) > nr_pages - off) + return -ENXIO; + + pages += off; + do { int ret = vm_insert_page(vma, uaddr, *pages++); if (ret) { |