diff options
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/alignment.c | 11 | ||||
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index b820edaf3184..db26e2e543f4 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -749,7 +749,6 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
749 | unsigned long instr = 0, instrptr; | 749 | unsigned long instr = 0, instrptr; |
750 | int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); | 750 | int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); |
751 | unsigned int type; | 751 | unsigned int type; |
752 | mm_segment_t fs; | ||
753 | unsigned int fault; | 752 | unsigned int fault; |
754 | u16 tinstr = 0; | 753 | u16 tinstr = 0; |
755 | int isize = 4; | 754 | int isize = 4; |
@@ -760,16 +759,15 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
760 | 759 | ||
761 | instrptr = instruction_pointer(regs); | 760 | instrptr = instruction_pointer(regs); |
762 | 761 | ||
763 | fs = get_fs(); | ||
764 | set_fs(KERNEL_DS); | ||
765 | if (thumb_mode(regs)) { | 762 | if (thumb_mode(regs)) { |
766 | fault = __get_user(tinstr, (u16 *)(instrptr & ~1)); | 763 | u16 *ptr = (u16 *)(instrptr & ~1); |
764 | fault = probe_kernel_address(ptr, tinstr); | ||
767 | if (!fault) { | 765 | if (!fault) { |
768 | if (cpu_architecture() >= CPU_ARCH_ARMv7 && | 766 | if (cpu_architecture() >= CPU_ARCH_ARMv7 && |
769 | IS_T32(tinstr)) { | 767 | IS_T32(tinstr)) { |
770 | /* Thumb-2 32-bit */ | 768 | /* Thumb-2 32-bit */ |
771 | u16 tinst2 = 0; | 769 | u16 tinst2 = 0; |
772 | fault = __get_user(tinst2, (u16 *)(instrptr+2)); | 770 | fault = probe_kernel_address(ptr + 1, tinst2); |
773 | instr = (tinstr << 16) | tinst2; | 771 | instr = (tinstr << 16) | tinst2; |
774 | thumb2_32b = 1; | 772 | thumb2_32b = 1; |
775 | } else { | 773 | } else { |
@@ -778,8 +776,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
778 | } | 776 | } |
779 | } | 777 | } |
780 | } else | 778 | } else |
781 | fault = __get_user(instr, (u32 *)instrptr); | 779 | fault = probe_kernel_address(instrptr, instr); |
782 | set_fs(fs); | ||
783 | 780 | ||
784 | if (fault) { | 781 | if (fault) { |
785 | type = TYPE_FAULT; | 782 | type = TYPE_FAULT; |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 076c26d43864..dda3904dc64c 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -640,7 +640,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, | |||
640 | 640 | ||
641 | if (is_coherent || nommu()) | 641 | if (is_coherent || nommu()) |
642 | addr = __alloc_simple_buffer(dev, size, gfp, &page); | 642 | addr = __alloc_simple_buffer(dev, size, gfp, &page); |
643 | else if (gfp & GFP_ATOMIC) | 643 | else if (!(gfp & __GFP_WAIT)) |
644 | addr = __alloc_from_pool(size, &page); | 644 | addr = __alloc_from_pool(size, &page); |
645 | else if (!IS_ENABLED(CONFIG_CMA)) | 645 | else if (!IS_ENABLED(CONFIG_CMA)) |
646 | addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller); | 646 | addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller); |