Skip to content

Commit 17e232b

Browse files
committed
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
2 parents 77c9622 + 7c65aa3 commit 17e232b

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

kernel/dma/debug.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ enum map_err_types {
6262
* @pfn: page frame of the start address
6363
* @offset: offset of mapping relative to pfn
6464
* @map_err_type: track whether dma_mapping_error() was checked
65-
* @stacktrace: support backtraces when a violation is detected
65+
* @stack_len: number of backtrace entries in @stack_entries
66+
* @stack_entries: stack of backtrace history
6667
*/
6768
struct dma_debug_entry {
6869
struct list_head list;

kernel/dma/swiotlb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,9 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
11361136
int cpu, i;
11371137
int index;
11381138

1139+
if (alloc_size > IO_TLB_SEGSIZE * IO_TLB_SIZE)
1140+
return -1;
1141+
11391142
cpu = raw_smp_processor_id();
11401143
for (i = 0; i < default_nareas; ++i) {
11411144
index = swiotlb_search_area(dev, cpu, i, orig_addr, alloc_size,

0 commit comments

Comments
 (0)