diff options
author | Mike Sinkovsky <msink@permonline.ru> | 2012-04-10 23:53:53 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-13 21:34:12 +0400 |
commit | 77577bf93275b485cecb4f358a085949c32e9dcd (patch) | |
tree | 3e65e14eccd1e5c61a2ed78da03031d30308da56 /drivers/net/ethernet/wiznet/w5300.c | |
parent | 9b17876f3e674a794a2d83aa47a9b356d36b7418 (diff) | |
download | linux-77577bf93275b485cecb4f358a085949c32e9dcd.tar.xz |
net: WIZnet drivers: fix possible NULL dereference
This fixes possible null dereference in probe() function: when both
.mac_addr and .link_gpio are unknown, dev.platform_data may be NULL
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mike Sinkovsky <msink@permonline.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/wiznet/w5300.c')
-rw-r--r-- | drivers/net/ethernet/wiznet/w5300.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c index f36addf9d2f6..3306a20ec211 100644 --- a/drivers/net/ethernet/wiznet/w5300.c +++ b/drivers/net/ethernet/wiznet/w5300.c @@ -594,7 +594,7 @@ static int __devinit w5300_hw_probe(struct platform_device *pdev) return ret; priv->irq = irq; - priv->link_gpio = data->link_gpio; + priv->link_gpio = data ? data->link_gpio : -EINVAL; if (gpio_is_valid(priv->link_gpio)) { char *link_name = devm_kzalloc(&pdev->dev, 16, GFP_KERNEL); if (!link_name) |