From: Daeseok Youn Date: Tue, 29 Apr 2014 09:49:47 +0000 (+0900) Subject: firewire: net: fix NULL derefencing in fwnet_probe() X-Git-Tag: next-20140516~69^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1118f8d048dd595efbadf05e8bca4e19684ffb4d;p=karo-tx-linux.git firewire: net: fix NULL derefencing in fwnet_probe() "dev" and "net" are NULL when alloc_netdev() is failed. So just unlock and return an error. Signed-off-by: Daeseok Youn Signed-off-by: Stefan Richter --- diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 4af0a7bad7f2..c3986452194d 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -1462,8 +1462,8 @@ static int fwnet_probe(struct fw_unit *unit, net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev); if (net == NULL) { - ret = -ENOMEM; - goto out; + mutex_unlock(&fwnet_device_mutex); + return -ENOMEM; } allocated_netdev = true;