Skip to content

Commit

Permalink
firewire: net: fix NULL derefencing in fwnet_probe()
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Daeseok Youn authored and Stefan Richter committed May 12, 2014
1 parent d6d211d commit 1118f8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/firewire/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1118f8d

Please sign in to comment.