Commit e78f96060fff8545d21360cfa5590e266a595bb9
Committed by
Tony Lindgren
1 parent
aecb9e1422
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
ARM: OMAP: Fix the use of uninitialized dma_lch_count
'omap_dma_reserve_channels' when used is suppose to be from command. so, it alreay has value before 1st call of omap_system_dma_probe. and it will never be changed again during running (not from ioctl). but 'dma_lch_count' is zero before 1st call of omap_system_dma_probe. so it will be failed for omap_dma_reserve_channels, when 1st call. so, need use 'd->lch_count' instead of 'dma_lch_count' for judging. Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
arch/arm/plat-omap/dma.c
... | ... | @@ -2019,7 +2019,7 @@ |
2019 | 2019 | errata = p->errata; |
2020 | 2020 | |
2021 | 2021 | if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels |
2022 | - && (omap_dma_reserve_channels <= dma_lch_count)) | |
2022 | + && (omap_dma_reserve_channels < d->lch_count)) | |
2023 | 2023 | d->lch_count = omap_dma_reserve_channels; |
2024 | 2024 | |
2025 | 2025 | dma_lch_count = d->lch_count; |