Skip to content

Commit 3028718

Browse files
Dan CarpenterVinod Koul
Dan Carpenter
authored and
Vinod Koul
committed
dmaengine: s3c24xx: missing unlock on an error path
We should unlock here before returning -EINVAL. Fixes: 39ad460 ('dmaengine: s3c24xx: Split device_control') Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent 68a8cc9 commit 3028718

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/dma/s3c24xx-dma.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,15 @@ static int s3c24xx_dma_terminate_all(struct dma_chan *chan)
718718
struct s3c24xx_dma_chan *s3cchan = to_s3c24xx_dma_chan(chan);
719719
struct s3c24xx_dma_engine *s3cdma = s3cchan->host;
720720
unsigned long flags;
721+
int ret = 0;
721722

722723
spin_lock_irqsave(&s3cchan->vc.lock, flags);
723724

724725
if (!s3cchan->phy && !s3cchan->at) {
725726
dev_err(&s3cdma->pdev->dev, "trying to terminate already stopped channel %d\n",
726727
s3cchan->id);
727-
return -EINVAL;
728+
ret = -EINVAL;
729+
goto unlock;
728730
}
729731

730732
s3cchan->state = S3C24XX_DMA_CHAN_IDLE;
@@ -741,10 +743,10 @@ static int s3c24xx_dma_terminate_all(struct dma_chan *chan)
741743

742744
/* Dequeue jobs not yet fired as well */
743745
s3c24xx_dma_free_txd_list(s3cdma, s3cchan);
744-
746+
unlock:
745747
spin_unlock_irqrestore(&s3cchan->vc.lock, flags);
746748

747-
return 0;
749+
return ret;
748750
}
749751

750752
static int s3c24xx_dma_alloc_chan_resources(struct dma_chan *chan)

0 commit comments

Comments
 (0)