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

* Re: [PATCH] make kmalloc error return unconditional in hysdn_net.c (245ac1)
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Germaschewski @ 2001-05-29  8:40 UTC (permalink / raw)
  To: Rasmus Andersen; +Cc: werner, isdn4linux, linux-kernel

On Mon, 28 May 2001, Rasmus Andersen wrote:

> 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.

Yep, you're obviously right. Thanks, I'll check in your patch into our
CVS, and push it to Alan. Actually, maybe it makes sense to use
alloc_netdev here, I'll have a look.

Thanks a lot,
--Kai


^ 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