The attached patch fixes a minor problem in sock_kmalloc. The test for available
space is done before the allocation and the size pre-added to the total, so
repeating the test for space after the allocation is not correct.
Regards,
Bill
--------------21B25BEB83E6CF0E38A31F91
Content-Type: text/plain; charset=us-ascii; name="net_sock88-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="net_sock88-patch"
--- net/core/sock.c.old Wed Feb 11 00:06:13 1998
+++ net/core/sock.c Wed Mar 4 22:18:29 1998
@@ -580,12 +580,8 @@
*/
atomic_add(size, &sk->wmem_alloc);
mem = kmalloc(size, priority);
- if (mem) {
- /* Recheck because kmalloc might sleep */
- if (atomic_read(&sk->wmem_alloc)+size < sk->sndbuf)
- return mem;
- kfree_s(mem, size);
- }
+ if (mem)
+ return mem;
atomic_sub(size, &sk->wmem_alloc);
}
return mem;
--------------21B25BEB83E6CF0E38A31F91--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu