kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] dmaengine: s3c24xx: missing unlock on an error path
@ 2015-01-30  8:29 Dan Carpenter
  2015-02-01 10:26 ` Maxime Ripard
  2015-02-05  1:53 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-01-30  8:29 UTC (permalink / raw)
  To: kernel-janitors

We should unlock here before returning -EINVAL.

Fixes: 39ad46009654 ('dmaengine: s3c24xx: Split device_control')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c
index 4d5a848..2f91da3 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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] dmaengine: s3c24xx: missing unlock on an error path
  2015-01-30  8:29 [patch] dmaengine: s3c24xx: missing unlock on an error path Dan Carpenter
@ 2015-02-01 10:26 ` Maxime Ripard
  2015-02-05  1:53 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2015-02-01 10:26 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

On Fri, Jan 30, 2015 at 11:29:33AM +0300, Dan Carpenter wrote:
> 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>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] dmaengine: s3c24xx: missing unlock on an error path
  2015-01-30  8:29 [patch] dmaengine: s3c24xx: missing unlock on an error path Dan Carpenter
  2015-02-01 10:26 ` Maxime Ripard
@ 2015-02-05  1:53 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2015-02-05  1:53 UTC (permalink / raw)
  To: kernel-janitors

On Fri, Jan 30, 2015 at 11:29:33AM +0300, Dan Carpenter wrote:
> We should unlock here before returning -EINVAL.
> 
> Fixes: 39ad46009654 ('dmaengine: s3c24xx: Split device_control')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks

-- 
~Vinod


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-05  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-30  8:29 [patch] dmaengine: s3c24xx: missing unlock on an error path Dan Carpenter
2015-02-01 10:26 ` Maxime Ripard
2015-02-05  1:53 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).