Re: [PATCH] core: dev: don't call BUG() on bad input

From: Stephen Hemminger
Date: Tue Feb 15 2011 - 18:02:27 EST


On Mon, 14 Feb 2011 13:56:06 +0300
Vasiliy Kulikov <segoon@xxxxxxxxxxxx> wrote:

> alloc_netdev() may be called with too long name (more that IFNAMSIZ bytes).
> Currently this leads to BUG(). Other insane inputs (bad txqs, rxqs) and
> even OOM don't lead to BUG(). Made alloc_netdev() return NULL, like on
> other errors.

The only way alloc_netdev could be called with a name too long
was if some driver was incorrectly written. It is not something
that can be exercised by user space.

Please leave the BUG() so the driver will show up in
kernel oops logs etc.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/