Date: Tue, 29 Apr 2014 18:49:47 +0900 From: Daeseok Youn Subject: 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 --- drivers/firewire/net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -1462,8 +1462,8 @@ static int fwnet_probe(struct fw_unit *u 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;