lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20090629154905.GD18570@linux-mips.org>
Date:	Mon, 29 Jun 2009 16:49:05 +0100
From:	Ralf Baechle <ralf@...ux-mips.org>
To:	Willy Tarreau <w@....eu>
Cc:	Frank Seidel <Frank.Seidel@...airon.com>,
	linux-mips@...ux-mips.org, netdev@...r.kernel.org
Subject: [PATCH] linux-2.4: br2684: allocation out of atomic context

From: Arne Redlich <redlicha@...airon.com>

Moved GFP_Kernel allocation out of atomic context

Signed-off-by: Arne Redlich <redlicha@...airon.com>
Signed-off-by: Frank Seidel <Frank.Seidel@...airon.com>
Signed-off-by: Ralf Baechle <ralf@...ux-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;
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ