Skip to contentSkip to conversation

: multipath_wrandom.c GPF fixes

IPV4 Patrick McHardy 2 participants 3 messages May 5, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

multipath_wrandom needs to use GFP_ATOMIC.

[IPV4]: multipath_wrandom.c GPF fixes

---
commit cdb5c875d48676b20ecd95fef080891a68c32e9c tree 46b576def0e0b0e4600193306cb830e66b5a57da parent 3a614a8969f79ac4116f496beff879736dca83e2 author Patrick McHardy <[email protected]> 1115277458 +0200 committer Patrick McHardy <[email protected]> 1115277458 +0200

net/ipv4/multipath_wrandom.c (mode:100644 sha1:c3d2ca1a6781513bc7b2524aad96f61e7a4053a6) renamed from net/ipv4/multipath_wrandom.c (mode:100644 sha1:10b23e1bece663bd8a9317f980b30ec0df7f0a11) +3 -3
Index: net/ipv4/multipath_wrandom.c
===================================================================
@@ -172,7 +172,7 @@
 		    multipath_comparekeys(&rt->fl, flp)) {
 			struct multipath_candidate* mpc =
 				(struct multipath_candidate*)
-				kmalloc(size_mpc, GFP_KERNEL);
+				kmalloc(size_mpc, GFP_ATOMIC);
 
 			if (!mpc)
 				return;
@@ -244,7 +244,7 @@
 	if (!target_route) {
 		const size_t size_rt = sizeof(struct multipath_route);
 		target_route = (struct multipath_route *)
-			kmalloc(size_rt, GFP_KERNEL);
+			kmalloc(size_rt, GFP_ATOMIC);
 
 		target_route->gw = nh->nh_gw;
 		target_route->oif = nh->nh_oif;
@@ -265,7 +265,7 @@
 	if (!target_dest) {
 		const size_t size_dst = sizeof(struct multipath_dest);
 		target_dest = (struct multipath_dest*)
-			kmalloc(size_dst, GFP_KERNEL);
+			kmalloc(size_dst, GFP_ATOMIC);
 
 		target_dest->nh_info = nh;
 		target_dest->network = network;
maintainer
#1 lore raw
Quoted 1 line · On Thu, 05 May 2005 22:31:06 +0200 Patrick McHardy <[email protected]> wrote:

multipath_wrandom needs to use GFP_ATOMIC.

I didn't fix this, because none of these allocations even check the return value so it's kind of pointless.

There is zero error handling in the multipath modules.

But I suppose it's best to get some of this fixed rather than none of it, so patch applied, thanks.

#2 lore raw
Quoted 7 lines · David S. Miller

I didn't fix this, because none of these allocations even check the return value so it's kind of pointless.

There is zero error handling in the multipath modules.

But I suppose it's best to get some of this fixed rather than none of it, so patch applied, thanks.

The first one is already checked, I'll look into the others.

Regards
Patrick