History

Merge tag 'dma-mapping-6.8-2024-01-18' of git://git.infradead.org/users/hch/dma-mapping

Pull dma-mapping fixes from Christoph Hellwig: - fix kerneldoc warnings (Randy Dunlap) - better bounds checking in swiotlb (ZhangPeng) * tag 'dma-mapping-6.8-2024-01-18' of git://git.infradead.org/users/hch/dma-mapping: dma-debug: fix kernel-doc warnings swiotlb: check alloc_size before the allocation of a new memory pool

Linus Torvalds committed 2 years ago

Commit 17e232b2 parents 77c9622 7c65aa32 files · +5 −1Browse files

Showing the changes to kernel (2 of 2 files). Show all

Unified · Split

2 files
  1. kernel/dma/debug.c +2 −1
  2. kernel/dma/swiotlb.c +3 −0
kernel/dma/debug.c+2−1
@@ -62,7 +62,8 @@ enum map_err_types { · 61 unmodified lines
62 * @pfn: page frame of the start address62 * @pfn: page frame of the start address
63 * @offset: offset of mapping relative to pfn63 * @offset: offset of mapping relative to pfn
64 * @map_err_type: track whether dma_mapping_error() was checked64 * @map_err_type: track whether dma_mapping_error() was checked
65 * @stacktrace: support backtraces when a violation is detected65 * @stack_len: number of backtrace entries in @stack_entries
66 * @stack_entries: stack of backtrace history
66 */67 */
67struct dma_debug_entry {68struct dma_debug_entry {
68 struct list_head list;69 struct list_head list;
kernel/dma/swiotlb.c+3−0
@@ -1136,6 +1136,9 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr, · 1135 unmodified lines
1136 int cpu, i;1136 int cpu, i;
1137 int index;1137 int index;
1138 1138
1139 if (alloc_size > IO_TLB_SEGSIZE * IO_TLB_SIZE)
1140 return -1;
1141
1139 cpu = raw_smp_processor_id();1142 cpu = raw_smp_processor_id();
1140 for (i = 0; i < default_nareas; ++i) {1143 for (i = 0; i < default_nareas; ++i) {
1141 index = swiotlb_search_area(dev, cpu, i, orig_addr, alloc_size,1144 index = swiotlb_search_area(dev, cpu, i, orig_addr, alloc_size,