[PATCH] make kmalloc error return unconditional in hysdn_net.c (245ac1)

Rasmus Andersen (rasmus@jaquet.dk)
Mon, 28 May 2001 22:53:05 +0200


Hi.

The patch below fixes what I believe is a bug in hysdn_net.c.
I cannot see how we can proceed under _any_ circumstances
after the kmalloc fails. Applies against 245ac1.

--- linux-245-ac1-clean/drivers/isdn/hysdn/hysdn_net.c Sun May 27 22:15:22 2001
+++ linux-245-ac1/drivers/isdn/hysdn/hysdn_net.c Mon May 28 22:44:16 2001
@@ -304,8 +304,7 @@
hysdn_net_release(card); /* release an existing net device */
if ((dev = kmalloc(sizeof(struct net_local), GFP_KERNEL)) == NULL) {
printk(KERN_WARNING "HYSDN: unable to allocate mem\n");
- if (card->debug_flags & LOG_NET_INIT)
- return (-ENOMEM);
+ return (-ENOMEM);
}
memset(dev, 0, sizeof(struct net_local)); /* clean the structure */

-- 
Regards,
        Rasmus(rasmus@jaquet.dk)

It has just been discovered that research causes cancer in rats. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/