git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
net
/
atm
/
resources.c
diff --git
a/net/atm/resources.c
b/net/atm/resources.c
index
18ac806
..
529f7e6
100644
(file)
--- a/
net/atm/resources.c
+++ b/
net/atm/resources.c
@@
-8,7
+8,6
@@
* use the default destruct function initialized by sock_init_data */
* use the default destruct function initialized by sock_init_data */
-#include <linux/config.h>
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/atmdev.h>
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/atmdev.h>
@@
-34,10
+33,9
@@
static struct atm_dev *__alloc_atm_dev(const char *type)
{
struct atm_dev *dev;
{
struct atm_dev *dev;
- dev = k
m
alloc(sizeof(*dev), GFP_KERNEL);
+ dev = k
z
alloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return NULL;
if (!dev)
return NULL;
- memset(dev, 0, sizeof(*dev));
dev->type = type;
dev->signal = ATM_PHY_SIG_UNKNOWN;
dev->link_rate = ATM_OC3_PCR;
dev->type = type;
dev->signal = ATM_PHY_SIG_UNKNOWN;
dev->link_rate = ATM_OC3_PCR;
@@
-114,14
+112,27
@@
struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
printk(KERN_ERR "atm_dev_register: "
"atm_proc_dev_register failed for dev %s\n",
type);
printk(KERN_ERR "atm_dev_register: "
"atm_proc_dev_register failed for dev %s\n",
type);
- mutex_unlock(&atm_dev_mutex);
- kfree(dev);
- return NULL;
+ goto out_fail;
+ }
+
+ if (atm_register_sysfs(dev) < 0) {
+ printk(KERN_ERR "atm_dev_register: "
+ "atm_register_sysfs failed for dev %s\n",
+ type);
+ atm_proc_dev_deregister(dev);
+ goto out_fail;
}
}
+
list_add_tail(&dev->dev_list, &atm_devs);
list_add_tail(&dev->dev_list, &atm_devs);
- mutex_unlock(&atm_dev_mutex);
+out:
+ mutex_unlock(&atm_dev_mutex);
return dev;
return dev;
+
+out_fail:
+ kfree(dev);
+ dev = NULL;
+ goto out;
}
}
@@
-140,6
+151,7
@@
void atm_dev_deregister(struct atm_dev *dev)
mutex_unlock(&atm_dev_mutex);
atm_dev_release_vccs(dev);
mutex_unlock(&atm_dev_mutex);
atm_dev_release_vccs(dev);
+ atm_unregister_sysfs(dev);
atm_proc_dev_deregister(dev);
atm_dev_put(dev);
atm_proc_dev_deregister(dev);
atm_dev_put(dev);