aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/pcie.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2011-02-23 14:49:30 -0700
committerColin Cross <ccross@android.com>2011-02-23 14:06:03 -0800
commitccac05152e7c6a8103b9e7a801bc995180a800fc (patch)
tree034bc068b7cd9c3042c52f3cf8dc77ccf701c098 /arch/arm/mach-tegra/pcie.c
parentddb7d5d80edb58e8235f1bc6c350eac40bfe85d1 (diff)
ARM: Tegra: DMA: Fail safe if initialization fails
tegra_dma_init currently simply bails out early if any initialization fails. This skips various data-structure initialization. In turn, this means that tegra_dma_allocate_channel can still hand out channels. In this case, when tegra_dma_free_channel is called, which calls tegra_dma_cancel, the walking on ch->list will OOPS since the list's next/prev pointers may still be NULL. To solve this, add an explicit "initialized" flag, only set this once _init has fully completed successfully, and have _allocate_channel refuse to hand out channels if this is not set. While at it, simplify _init: * Remove redundant memsets * Use bitmap_fill to mark all channels as in-use up-front, and remove some now-redundant bitmap initialization loops. * Only mark a channel as free once all channel-related initialization has completed. Finally, the successful exit path from _init always has ret==0, so just hard-code that return. The error path still returns ret. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/pcie.c')
0 files changed, 0 insertions, 0 deletions