[PATCH 19/38] net: atm: add missing put_device call

Levente Kurusa
2013-12-19T15:04:54Z

net/atm/atm_sysfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
index 350bf62..0e070c2 100644
--- a/net/atm/atm_sysfs.c
+++ b/net/atm/atm_sysfs.c
@@ -154,8 +154,10 @@ int atm_register_sysfs(struct atm_dev *adev, struct device *parent)

dev_set_name(cdev, "%s%d", adev->type, adev->number);
err = device_register(cdev);
- if (err < 0)
+ if (err < 0) {
+ put_device(cdev);
return err;
+ }

for (i = 0; atm_attrs[i]; i++) {
err = device_create_file(cdev, atm_attrs[i]);
--
1.8.3.1