aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2009-09-11 04:28:38 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-11 04:29:45 -0400
commitc6304933274f8e3cc6983d496456757ac8ab2e0b (patch)
tree7d9135cc2f391141650cc2d1740bd276a25f6141 /drivers/s390/char
parentc48ff644f2c86f34f69f382b68b16c6d30854783 (diff)
[S390] proper use of device register
Don't use kfree directly after device registration started. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char')
-rw-r--r--drivers/s390/char/monreader.c2
-rw-r--r--drivers/s390/char/vmlogrdr.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 3234e90bd7f9..89ece1c235aa 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -581,7 +581,7 @@ static int __init mon_init(void)
581 monreader_device->release = (void (*)(struct device *))kfree; 581 monreader_device->release = (void (*)(struct device *))kfree;
582 rc = device_register(monreader_device); 582 rc = device_register(monreader_device);
583 if (rc) { 583 if (rc) {
584 kfree(monreader_device); 584 put_device(monreader_device);
585 goto out_driver; 585 goto out_driver;
586 } 586 }
587 587
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index c20a4fe6da51..d1a142fa3eb4 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -765,8 +765,10 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
765 } else 765 } else
766 return -ENOMEM; 766 return -ENOMEM;
767 ret = device_register(dev); 767 ret = device_register(dev);
768 if (ret) 768 if (ret) {
769 put_device(dev);
769 return ret; 770 return ret;
771 }
770 772
771 ret = sysfs_create_group(&dev->kobj, &vmlogrdr_attr_group); 773 ret = sysfs_create_group(&dev->kobj, &vmlogrdr_attr_group);
772 if (ret) { 774 if (ret) {