firewire: fix NULL derefencing in fwnet_probe()
PATCH 1/1 firewire: 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 <[email protected]>
--- drivers/firewire/net.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/firewire/net.c +2 -2
@@ -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;
Signature · 1 line
1.7.4.4
Stefan Richter
AppliedQuoted 4 lines · On Apr 29 Daeseok Youn wrote:
"dev" and "net" are NULL when
alloc_netdev()is failed. So just unlock and return an error.Signed-off-by Daeseok Youn <[email protected]>
Pushed to linux1394.git. Thank you.
Quoted 19 lines
--- drivers/firewire/net.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/firewire/net.c +2
-2@@ -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;
Signature · 3 lines
Stefan Richter -=====-====- -=-= -==-- http://arcgraph.de/sr/