diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-01-30 11:29:33 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-02-05 04:52:42 +0300 |
commit | 3028718fd06bb931868a1a8068eab7396a7a622a (patch) | |
tree | 9f4ed3aee6d6296f24a6172fca6fc892e09b8954 /drivers/dma | |
parent | 68a8cc9e9e57abcf2b4f40fb54fb8fb3c7f0462e (diff) | |
download | linux-3028718fd06bb931868a1a8068eab7396a7a622a.tar.xz |
dmaengine: s3c24xx: missing unlock on an error path
We should unlock here before returning -EINVAL.
Fixes: 39ad46009654 ('dmaengine: s3c24xx: Split device_control')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/s3c24xx-dma.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c index 4d5a84815ba7..2f91da3db836 100644 --- a/drivers/dma/s3c24xx-dma.c +++ b/drivers/dma/s3c24xx-dma.c @@ -718,13 +718,15 @@ static int s3c24xx_dma_terminate_all(struct dma_chan *chan) struct s3c24xx_dma_chan *s3cchan = to_s3c24xx_dma_chan(chan); struct s3c24xx_dma_engine *s3cdma = s3cchan->host; unsigned long flags; + int ret = 0; spin_lock_irqsave(&s3cchan->vc.lock, flags); if (!s3cchan->phy && !s3cchan->at) { dev_err(&s3cdma->pdev->dev, "trying to terminate already stopped channel %d\n", s3cchan->id); - return -EINVAL; + ret = -EINVAL; + goto unlock; } s3cchan->state = S3C24XX_DMA_CHAN_IDLE; @@ -741,10 +743,10 @@ static int s3c24xx_dma_terminate_all(struct dma_chan *chan) /* Dequeue jobs not yet fired as well */ s3c24xx_dma_free_txd_list(s3cdma, s3cchan); - +unlock: spin_unlock_irqrestore(&s3cchan->vc.lock, flags); - return 0; + return ret; } static int s3c24xx_dma_alloc_chan_resources(struct dma_chan *chan) |