Skip to content

Commit 1118f8d

Browse files
daeseokyounStefan Richter
authored andcommitted
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>
1 parent d6d211d commit 1118f8d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/firewire/net.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,8 +1462,8 @@ static int fwnet_probe(struct fw_unit *unit,
14621462

14631463
net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev);
14641464
if (net == NULL) {
1465-
ret = -ENOMEM;
1466-
goto out;
1465+
mutex_unlock(&fwnet_device_mutex);
1466+
return -ENOMEM;
14671467
}
14681468

14691469
allocated_netdev = true;

0 commit comments

Comments
 (0)