summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaeseok Youn <daeseok.youn@gmail.com>2014-04-29 11:49:47 +0200
committerStefan Richter <stefanr@s5r6.in-berlin.de>2014-05-12 14:35:31 +0200
commit1118f8d048dd595efbadf05e8bca4e19684ffb4d (patch)
treeaf6b68e21a76f9d077f6b01d62d59bfee25ee079 /drivers
parentLinux 3.15-rc5 (diff)
downloadlinux-1118f8d048dd595efbadf05e8bca4e19684ffb4d.tar.xz
linux-1118f8d048dd595efbadf05e8bca4e19684ffb4d.zip
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 <daeseok.youn@gmail.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/net.c4
1 files changed, 2 insertions, 2 deletions
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;