diff options
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/netiucv.c | 9 | ||||
-rw-r--r-- | drivers/s390/net/smsgiucv.c | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 8c36eafcfbfe..87dff11061b0 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -1839,9 +1839,10 @@ static int netiucv_register_device(struct net_device *ndev) | |||
1839 | return -ENOMEM; | 1839 | return -ENOMEM; |
1840 | 1840 | ||
1841 | ret = device_register(dev); | 1841 | ret = device_register(dev); |
1842 | 1842 | if (ret) { | |
1843 | if (ret) | 1843 | put_device(dev); |
1844 | return ret; | 1844 | return ret; |
1845 | } | ||
1845 | ret = netiucv_add_files(dev); | 1846 | ret = netiucv_add_files(dev); |
1846 | if (ret) | 1847 | if (ret) |
1847 | goto out_unreg; | 1848 | goto out_unreg; |
@@ -2226,8 +2227,10 @@ static int __init netiucv_init(void) | |||
2226 | netiucv_dev->release = (void (*)(struct device *))kfree; | 2227 | netiucv_dev->release = (void (*)(struct device *))kfree; |
2227 | netiucv_dev->driver = &netiucv_driver; | 2228 | netiucv_dev->driver = &netiucv_driver; |
2228 | rc = device_register(netiucv_dev); | 2229 | rc = device_register(netiucv_dev); |
2229 | if (rc) | 2230 | if (rc) { |
2231 | put_device(netiucv_dev); | ||
2230 | goto out_driver; | 2232 | goto out_driver; |
2233 | } | ||
2231 | netiucv_banner(); | 2234 | netiucv_banner(); |
2232 | return rc; | 2235 | return rc; |
2233 | 2236 | ||
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index e76a320d373b..102000d1af6f 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c | |||
@@ -219,13 +219,13 @@ static int __init smsg_init(void) | |||
219 | smsg_dev->driver = &smsg_driver; | 219 | smsg_dev->driver = &smsg_driver; |
220 | rc = device_register(smsg_dev); | 220 | rc = device_register(smsg_dev); |
221 | if (rc) | 221 | if (rc) |
222 | goto out_free_dev; | 222 | goto out_put; |
223 | 223 | ||
224 | cpcmd("SET SMSG IUCV", NULL, 0, NULL); | 224 | cpcmd("SET SMSG IUCV", NULL, 0, NULL); |
225 | return 0; | 225 | return 0; |
226 | 226 | ||
227 | out_free_dev: | 227 | out_put: |
228 | kfree(smsg_dev); | 228 | put_device(smsg_dev); |
229 | out_free_path: | 229 | out_free_path: |
230 | iucv_path_free(smsg_path); | 230 | iucv_path_free(smsg_path); |
231 | smsg_path = NULL; | 231 | smsg_path = NULL; |