[PATCH 2.6.19-rc3 1/2] ehea: kzalloc GFP_ATOMIC fix

Subsystems: networking drivers, the rest

STALE7257d

4 messages, 4 authors, 2006-11-01 · open the first message on its own page

[PATCH 2.6.19-rc3 1/2] ehea: kzalloc GFP_ATOMIC fix

From: Jan-Bernd Themann <hidden>
Date: 2006-10-25 12:01:16

This patch fixes kzalloc parameters (GFP_ATOMIC instead of GFP_KERNEL)

Signed-off-by: Jan-Bernd Themann <redacted>
---
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index eb7d44d..4538c99 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -586,8 +586,8 @@ int ehea_sense_port_attr(struct ehea_por
 	u64 hret;
 	struct hcp_ehea_port_cb0 *cb0;
 
-	cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
-	if (!cb0) {
+	cb0 = kzalloc(H_CB_ALIGNMENT, GFP_ATOMIC);   /* May be called via */
+	if (!cb0) {                                  /* ehea_neq_tasklet() */
 		ehea_error("no mem for cb0");
 		ret = -ENOMEM;
 		goto out;
@@ -765,8 +765,7 @@ static void ehea_parse_eqe(struct ehea_a
 
 		if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) {
 			if (!netif_carrier_ok(port->netdev)) {
-				ret = ehea_sense_port_attr(
-					port);
+				ret = ehea_sense_port_attr(port);
 				if (ret) {
 					ehea_error("failed resensing port "
 						   "attributes");
@@ -1502,7 +1501,7 @@ static void ehea_promiscuous(struct net_
 	if ((enable && port->promisc) || (!enable && !port->promisc))
 		return;
 
-	cb7 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+	cb7 = kzalloc(H_CB_ALIGNMENT, GFP_ATOMIC);
 	if (!cb7) {
 		ehea_error("no mem for cb7");
 		goto out;
@@ -1606,7 +1605,7 @@ static void ehea_add_multicast_entry(str
 	struct ehea_mc_list *ehea_mcl_entry;
 	u64 hret;
 
-	ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_KERNEL);
+	ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC);
 	if (!ehea_mcl_entry) {
 		ehea_error("no mem for mcl_entry");
 		return;

Re: [PATCH 2.6.19-rc3 1/2] ehea: kzalloc GFP_ATOMIC fix

From: Andrew Morton <hidden>
Date: 2006-10-27 03:14:07

On Wed, 25 Oct 2006 13:11:42 +0200
Jan-Bernd Themann [off-list ref] wrote:
This patch fixes kzalloc parameters (GFP_ATOMIC instead of GFP_KERNEL)
why?

Re: [PATCH 2.6.19-rc3 1/2] ehea: kzalloc GFP_ATOMIC fix

From: Christoph Raisch <hidden>
Date: 2006-10-27 11:15:21

Andrew Morton [off-list ref] wrote on 27.10.2006 05:13:13:
On Wed, 25 Oct 2006 13:11:42 +0200
Jan-Bernd Themann [off-list ref] wrote:
quoted
This patch fixes kzalloc parameters (GFP_ATOMIC instead of GFP_KERNEL)
why?

these few kcallocs run in atomic context in some situations.
therefore GFP_KERNEL is no good idea.

Christoph R.

Re: [PATCH 2.6.19-rc3 1/2] ehea: kzalloc GFP_ATOMIC fix

From: Jeff Garzik <hidden>
Date: 2006-11-01 01:20:21

Jan-Bernd Themann wrote:
This patch fixes kzalloc parameters (GFP_ATOMIC instead of GFP_KERNEL)

Signed-off-by: Jan-Bernd Themann <redacted>
applied to #upstream-fixes

In the future, please include a description of -why- patches like this 
are needed (I got the info from your replies in this case)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help