Re: [PATCH] checking kmalloc, init_etherdev and other fixes

Arnaldo Carvalho de Melo (acme@conectiva.com.br)
Tue, 8 Aug 2000 01:18:41 -0300


Em Mon, Aug 07, 2000 at 08:48:37PM -0700, David S. Miller escreveu:
> 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.

ouch, brown paper bag, shame on me, I'm rechecking and sending it back,
thanks for the fast feedback.

And sorry as well for the two other posts, I've sent them cause I've
got this:

X-URL: http://lists.samba.org/

Your posting to list LINUX-KERNEL was rejected.
Reason: message size limit exceeded (maximum allowed: 40000 bytes)
The first few lines of your message are included herein for reference:

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

of course not :(

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

- Arnaldo

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