Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1118f8d0 authored by Daeseok Youn's avatar Daeseok Youn Committed by Stefan Richter
Browse files

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: default avatarDaeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent d6d211db
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;