]> git.baikalelectronics.ru Git - kernel.git/commit
stmmac: prevent probe drivers to crash kernel
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 27 Jan 2015 16:38:03 +0000 (18:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jan 2015 20:24:30 +0000 (12:24 -0800)
commit0ea4a9af4a116cf1e1348815ca235c5859ae4595
treeb377e0790a0889110cf17a20470cc433b626336b
parent4461da2587062308e0e8bfa2a1352d05e20aee42
stmmac: prevent probe drivers to crash kernel

In the case when alloc_netdev fails we return NULL to a caller. But there is no
check for NULL in the probe drivers. This patch changes NULL to an error
pointer. The function description is amended to reflect what we may get
returned.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c