diff options
author | Daeseok Youn <daeseok.youn@gmail.com> | 2014-04-29 05:49:47 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2014-05-12 08:35:31 -0400 |
commit | 1118f8d048dd595efbadf05e8bca4e19684ffb4d (patch) | |
tree | af6b68e21a76f9d077f6b01d62d59bfee25ee079 /drivers/firewire | |
parent | d6d211db37e75de2ddc3a4f979038c40df7cc79c (diff) |
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.c | 4 |
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, | |||
1462 | 1462 | ||
1463 | net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev); | 1463 | net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev); |
1464 | if (net == NULL) { | 1464 | if (net == NULL) { |
1465 | ret = -ENOMEM; | 1465 | mutex_unlock(&fwnet_device_mutex); |
1466 | goto out; | 1466 | return -ENOMEM; |
1467 | } | 1467 | } |
1468 | 1468 | ||
1469 | allocated_netdev = true; | 1469 | allocated_netdev = true; |