summaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorDaeseok Youn <daeseok.youn@gmail.com>2014-04-29 18:49:47 +0900
committerStefan Richter <stefanr@s5r6.in-berlin.de>2014-05-12 14:35:31 +0200
commit1118f8d048dd595efbadf05e8bca4e19684ffb4d (patch)
treeaf6b68e21a76f9d077f6b01d62d59bfee25ee079 /drivers/firewire
parentd6d211db37e75de2ddc3a4f979038c40df7cc79c (diff)
downloadblackbird-op-linux-1118f8d048dd595efbadf05e8bca4e19684ffb4d.tar.gz
blackbird-op-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/firewire')
-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;
OpenPOWER on IntegriCloud