lkml.org 
[lkml]   [2000]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] checking kmalloc, init_etherdev and other fixes
   Date: 	Tue, 8 Aug 2000 00:55:42 -0300
From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>

This patch mostly includes checks for kmalloc and init_etherdev
in the net drivers, but also fixes some bugs on some drivers,
please take a look and consider aplying.

Plain visial inspection found at least a problem in this part of
patch.

diff -uNr linux-2.4.0-test6-pre7/drivers/net/3c507.c linux-2.4.0-test6-pre7.acme/drivers/net/3c507.c
--- linux-2.4.0-test6-pre7/drivers/net/3c507.c Mon Jun 19 17:30:56 2000
+++ linux-2.4.0-test6-pre7.acme/drivers/net/3c507.c Mon Aug 7 23:56:50 2000
@@ -355,7 +355,8 @@

/* Allocate a new 'dev' if needed. */
if (dev == NULL)
- dev = init_etherdev(0, sizeof(struct net_local));
+ if ((dev = init_etherdev(0, sizeof(struct net_local))))
+ return -ENOMEM;


If the allocation succeeds we should return an error?
Surely you made a logic error. I did not even scan the rest of the
patch since such a simple error like this showed up so early in it.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.039 / U:2.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site