diff options
| -rw-r--r-- | fs/proc/generic.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 9e8f63164309..0d80cef4cfb9 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
| @@ -605,7 +605,8 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent, | |||
| 605 | unsigned int len; | 605 | unsigned int len; |
| 606 | 606 | ||
| 607 | /* make sure name is valid */ | 607 | /* make sure name is valid */ |
| 608 | if (!name || !strlen(name)) goto out; | 608 | if (!name || !strlen(name)) |
| 609 | goto out; | ||
| 609 | 610 | ||
| 610 | if (xlate_proc_name(name, parent, &fn) != 0) | 611 | if (xlate_proc_name(name, parent, &fn) != 0) |
| 611 | goto out; | 612 | goto out; |
| @@ -616,20 +617,18 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent, | |||
| 616 | 617 | ||
| 617 | len = strlen(fn); | 618 | len = strlen(fn); |
| 618 | 619 | ||
| 619 | ent = kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL); | 620 | ent = kzalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL); |
| 620 | if (!ent) goto out; | 621 | if (!ent) |
| 622 | goto out; | ||
| 621 | 623 | ||
| 622 | memset(ent, 0, sizeof(struct proc_dir_entry)); | ||
| 623 | memcpy(ent->name, fn, len + 1); | 624 | memcpy(ent->name, fn, len + 1); |
| 624 | ent->namelen = len; | 625 | ent->namelen = len; |
| 625 | ent->mode = mode; | 626 | ent->mode = mode; |
| 626 | ent->nlink = nlink; | 627 | ent->nlink = nlink; |
| 627 | atomic_set(&ent->count, 1); | 628 | atomic_set(&ent->count, 1); |
| 628 | ent->pde_users = 0; | ||
| 629 | spin_lock_init(&ent->pde_unload_lock); | 629 | spin_lock_init(&ent->pde_unload_lock); |
| 630 | ent->pde_unload_completion = NULL; | ||
| 631 | INIT_LIST_HEAD(&ent->pde_openers); | 630 | INIT_LIST_HEAD(&ent->pde_openers); |
| 632 | out: | 631 | out: |
| 633 | return ent; | 632 | return ent; |
| 634 | } | 633 | } |
| 635 | 634 | ||
