2002-10-02 05:09:16

by Zwane Mwaikambo

[permalink] [raw]
Subject: [PATCH][2.5] sctp: possible sleep w/ lock held

Index: linux-2.5.40/net/sctp/protocol.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.40/net/sctp/protocol.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 protocol.c
--- linux-2.5.40/net/sctp/protocol.c 1 Oct 2002 12:29:11 -0000 1.1.1.1
+++ linux-2.5.40/net/sctp/protocol.c 2 Oct 2002 03:26:30 -0000
@@ -119,8 +119,7 @@

for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
/* Add the address to the local list. */
- /* XXX BUG: sleeping allocation with lock held -DaveM */
- addr = t_new(struct sockaddr_storage_list, GFP_KERNEL);
+ addr = t_new(struct sockaddr_storage_list, GFP_ATOMIC);
if (addr) {
INIT_LIST_HEAD(&addr->list);
addr->a.v4.sin_family = AF_INET;
@@ -157,8 +156,7 @@
read_lock_bh(&in6_dev->lock);
for (ifp = in6_dev->addr_list; ifp; ifp = ifp->if_next) {
/* Add the address to the local list. */
- /* XXX BUG: sleeping allocation with lock held -DaveM */
- addr = t_new(struct sockaddr_storage_list, GFP_KERNEL);
+ addr = t_new(struct sockaddr_storage_list, GFP_ATOMIC);
if (addr) {
addr->a.v6.sin6_family = AF_INET6;
addr->a.v6.sin6_port = 0;

--
function.linuxpower.ca