diff mbox

[Linaro-mm-sig,1/2,-next] dma-buf: double unlock in debugfs code

Message ID 20130411062339.GA7603@elgon.mountain
State New
Headers show

Commit Message

Dan Carpenter April 11, 2013, 6:23 a.m. UTC
We unlock here when we failed to take the lock.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is in linux-next, and I think the debugfs code is only in Sumit's
tree.

Comments

Dan Carpenter April 11, 2013, 6:27 a.m. UTC | #1
Oops...  I mailed that prematurely.  There isn't a [patch 2/2].

regards,
dan carpenter
Greg Kroah-Hartman April 11, 2013, 7:40 p.m. UTC | #2
On Thu, Apr 11, 2013 at 09:23:39AM +0300, Dan Carpenter wrote:
> We unlock here when we failed to take the lock.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is in linux-next, and I think the debugfs code is only in Sumit's
> tree.

Yes, it's not in mine, so I can't take this, sorry.  Sumit, please apply
this:

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sumit Semwal April 12, 2013, 3:13 a.m. UTC | #3
Hi Dan,

On Apr 11, 2013 11:54 AM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:
>
> We unlock here when we failed to take the lock.
Thanks for catching this; I will add it to the for-next queue.

Could I merge this change with the main patch while submitting to mainline?
With an attribution to you, of course.

Best regards,
-Sumit.

>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is in linux-next, and I think the debugfs code is only in Sumit's
> tree.
>
> diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
> index 466476f..174cd2c 100644
> --- a/drivers/base/dma-buf.c
> +++ b/drivers/base/dma-buf.c
> @@ -593,7 +593,7 @@ static int dma_buf_describe(struct seq_file *s)
>                 if (ret) {
>                         seq_printf(s,
>                                   "\tERROR locking buffer object:
skipping\n");
> -                       goto skip_buffer;
> +                       continue;
>                 }
>
>                 seq_printf(s, "\t");
> @@ -618,7 +618,6 @@ static int dma_buf_describe(struct seq_file *s)
>
>                 count++;
>                 size += buf_obj->size;
> -skip_buffer:
>                 mutex_unlock(&buf_obj->lock);
>         }
>
Dan Carpenter April 12, 2013, 5:59 a.m. UTC | #4
On Fri, Apr 12, 2013 at 08:43:05AM +0530, Sumit Semwal wrote:
> Hi Dan,
> 
> On Apr 11, 2013 11:54 AM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:
> >
> > We unlock here when we failed to take the lock.
> Thanks for catching this; I will add it to the for-next queue.
> 
> Could I merge this change with the main patch while submitting to mainline?
> With an attribution to you, of course.

Yeah.  Just merge it.  Don't stress about attribution.

regards,
dan carpenter
diff mbox

Patch

diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index 466476f..174cd2c 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -593,7 +593,7 @@  static int dma_buf_describe(struct seq_file *s)
 		if (ret) {
 			seq_printf(s,
 				  "\tERROR locking buffer object: skipping\n");
-			goto skip_buffer;
+			continue;
 		}
 
 		seq_printf(s, "\t");
@@ -618,7 +618,6 @@  static int dma_buf_describe(struct seq_file *s)
 
 		count++;
 		size += buf_obj->size;
-skip_buffer:
 		mutex_unlock(&buf_obj->lock);
 	}