Commit 1583e653 authored by Evgeniy Polyakov's avatar Evgeniy Polyakov Committed by Greg Kroah-Hartman

[PATCH] W1: check nls in return path.

Check netlink socket being non NULL in error return path.
Signed-off-by: default avatarEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent b589eb2f
...@@ -96,7 +96,7 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl, ...@@ -96,7 +96,7 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
err = device_register(&dev->dev); err = device_register(&dev->dev);
if (err) { if (err) {
printk(KERN_ERR "Failed to register master device. err=%d\n", err); printk(KERN_ERR "Failed to register master device. err=%d\n", err);
if (dev->nls->sk_socket) if (dev->nls && dev->nls->sk_socket)
sock_release(dev->nls->sk_socket); sock_release(dev->nls->sk_socket);
memset(dev, 0, sizeof(struct w1_master)); memset(dev, 0, sizeof(struct w1_master));
kfree(dev); kfree(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment