public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make kmalloc error return unconditional in hysdn_net.c (245ac1)
@ 2001-05-28 20:53 Rasmus Andersen
  2001-05-29  8:40 ` Kai Germaschewski
  0 siblings, 1 reply; 2+ messages in thread
From: Rasmus Andersen @ 2001-05-28 20:53 UTC (permalink / raw)
  To: werner; +Cc: isdn4linux, linux-kernel

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. 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-29  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-28 20:53 [PATCH] make kmalloc error return unconditional in hysdn_net.c (245ac1) Rasmus Andersen
2001-05-29  8:40 ` Kai Germaschewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox