All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] gru-unlocking-should-be-conditional-in-gru_dump_context.patch removed from -mm tree
@ 2014-02-11 19:23 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2014-02-11 19:23 UTC (permalink / raw)
  To: mm-commits, sivanich, dan.carpenter

Subject: [merged] gru-unlocking-should-be-conditional-in-gru_dump_context.patch removed from -mm tree
To: dan.carpenter@oracle.com,sivanich@sgi.com,mm-commits@vger.kernel.org
From: akpm@linux-foundation.org
Date: Tue, 11 Feb 2014 11:23:15 -0800


The patch titled
     Subject: drivers/misc/sgi-gru/grukdump.c: unlocking should be conditional in gru_dump_context()
has been removed from the -mm tree.  Its filename was
     gru-unlocking-should-be-conditional-in-gru_dump_context.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
Subject: drivers/misc/sgi-gru/grukdump.c: unlocking should be conditional in gru_dump_context()

I was reviewing this and noticed that unlocking should be conditional on
the error path.  I've changed it to unlock and return directly since we
only do it once and it seems unlikely to change in the near future.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dimitri Sivanich <sivanich@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/misc/sgi-gru/grukdump.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff -puN drivers/misc/sgi-gru/grukdump.c~gru-unlocking-should-be-conditional-in-gru_dump_context drivers/misc/sgi-gru/grukdump.c
--- a/drivers/misc/sgi-gru/grukdump.c~gru-unlocking-should-be-conditional-in-gru_dump_context
+++ a/drivers/misc/sgi-gru/grukdump.c
@@ -139,8 +139,11 @@ static int gru_dump_context(struct gru_s
 
 	ubuf += sizeof(hdr);
 	ubufcch = ubuf;
-	if (gru_user_copy_handle(&ubuf, cch))
-		goto fail;
+	if (gru_user_copy_handle(&ubuf, cch)) {
+		if (cch_locked)
+			unlock_cch_handle(cch);
+		return -EFAULT;
+	}
 	if (cch_locked)
 		ubufcch->delresp = 0;
 	bytes = sizeof(hdr) + GRU_CACHE_LINE_BYTES;
@@ -179,10 +182,6 @@ static int gru_dump_context(struct gru_s
 		ret = -EFAULT;
 
 	return ret ? ret : bytes;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-11 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-11 19:23 [merged] gru-unlocking-should-be-conditional-in-gru_dump_context.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.