netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux-2.4: br2684: allocation out of atomic context
@ 2009-06-29 15:49 Ralf Baechle
  0 siblings, 0 replies; only message in thread
From: Ralf Baechle @ 2009-06-29 15:49 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: Frank Seidel, linux-mips, netdev

From: Arne Redlich <redlicha@sphairon.com>

Moved GFP_Kernel allocation out of atomic context

Signed-off-by: Arne Redlich <redlicha@sphairon.com>
Signed-off-by: Frank Seidel <Frank.Seidel@sphairon.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
 net/atm/br2684.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -509,6 +509,10 @@ Note: we do not have explicit unassign,
 		MOD_DEC_USE_COUNT;
 		return -EFAULT;
 	}
+	brvcc = kmalloc(sizeof(struct br2684_vcc), GFP_KERNEL);
+	if (!brvcc)
+		return -ENOMEM;
+	memset(brvcc, 0, sizeof(struct br2684_vcc));
 	write_lock_irq(&devs_lock);
 	brdev = br2684_find_dev(&be.ifspec);
 	if (brdev == NULL) {
@@ -532,11 +536,6 @@ Note: we do not have explicit unassign,
 		err = -EINVAL;
 		goto error;
 	}
-	brvcc = kmalloc(sizeof(struct br2684_vcc), GFP_KERNEL);
-	if (!brvcc) {
-		err = -ENOMEM;
-		goto error;
-	}
 	memset(brvcc, 0, sizeof(struct br2684_vcc));
 	DPRINTK("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps,
 		brvcc);
@@ -567,6 +566,7 @@ Note: we do not have explicit unassign,
 	return 0;
     error:
 	write_unlock_irq(&devs_lock);
+	kfree(brvcc);
 	MOD_DEC_USE_COUNT;
 	return err;
 }

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

only message in thread, other threads:[~2009-06-29 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-29 15:49 [PATCH] linux-2.4: br2684: allocation out of atomic context Ralf Baechle

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).