Skip to content

Commit f49237b

Browse files
committed
Merge tag 'dmaengine-fix-4.11-rc5' of git://git.infradead.org/users/vkoul/slave-dma
Pull dmaengine fixes from Vinod Koul: "A couple of minor fixes for 4.11: - array bound fix for __get_unmap_pool() - cyclic period splitting for bcm2835" * tag 'dmaengine-fix-4.11-rc5' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: Fix array index out of bounds warning in __get_unmap_pool() dmaengine: bcm2835: Fix cyclic DMA period splitting
2 parents 496dcc5 + 23f963e commit f49237b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/dma/bcm2835-dma.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,11 @@ static void bcm2835_dma_create_cb_set_length(
251251
*/
252252

253253
/* have we filled in period_length yet? */
254-
if (*total_len + control_block->length < period_len)
254+
if (*total_len + control_block->length < period_len) {
255+
/* update number of bytes in this period so far */
256+
*total_len += control_block->length;
255257
return;
258+
}
256259

257260
/* calculate the length that remains to reach period_length */
258261
control_block->length = period_len - *total_len;

drivers/dma/dmaengine.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,12 +1108,14 @@ static struct dmaengine_unmap_pool *__get_unmap_pool(int nr)
11081108
switch (order) {
11091109
case 0 ... 1:
11101110
return &unmap_pool[0];
1111+
#if IS_ENABLED(CONFIG_DMA_ENGINE_RAID)
11111112
case 2 ... 4:
11121113
return &unmap_pool[1];
11131114
case 5 ... 7:
11141115
return &unmap_pool[2];
11151116
case 8:
11161117
return &unmap_pool[3];
1118+
#endif
11171119
default:
11181120
BUG();
11191121
return NULL;

0 commit comments

Comments
 (0)