diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-27 13:28:34 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-27 13:28:34 -0400 |
| commit | 005fbcd03458b6c0044f65c1fe8d8a68d726a321 (patch) | |
| tree | 60265e75c50f3acf802e195363f44b8a10acdf80 | |
| parent | fefb82756e9fd89d0c0d5983e056df81d51eb075 (diff) | |
| parent | 0c8c77d35582c3f7989f1316368da5ae7f14ad4b (diff) | |
Merge tag 'driver-core-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH:
"Here are some kernfs fixes for 3.15-rc3 that resolve some reported
problems. Nothing huge, but all needed"
* tag 'driver-core-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
s390/ccwgroup: Fix memory corruption
kernfs: add back missing error check in kernfs_fop_mmap()
kernfs: fix a subdir count leak
| -rw-r--r-- | arch/s390/include/asm/ccwgroup.h | 2 | ||||
| -rw-r--r-- | fs/kernfs/dir.c | 9 | ||||
| -rw-r--r-- | fs/kernfs/file.c | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/arch/s390/include/asm/ccwgroup.h b/arch/s390/include/asm/ccwgroup.h index 6e670f88d125..ebc2913f9ee0 100644 --- a/arch/s390/include/asm/ccwgroup.h +++ b/arch/s390/include/asm/ccwgroup.h | |||
| @@ -22,8 +22,8 @@ struct ccwgroup_device { | |||
| 22 | /* public: */ | 22 | /* public: */ |
| 23 | unsigned int count; | 23 | unsigned int count; |
| 24 | struct device dev; | 24 | struct device dev; |
| 25 | struct ccw_device *cdev[0]; | ||
| 26 | struct work_struct ungroup_work; | 25 | struct work_struct ungroup_work; |
| 26 | struct ccw_device *cdev[0]; | ||
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | /** | 29 | /** |
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 78f3403300af..ac127cd008bf 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c | |||
| @@ -232,9 +232,6 @@ static int kernfs_link_sibling(struct kernfs_node *kn) | |||
| 232 | struct rb_node **node = &kn->parent->dir.children.rb_node; | 232 | struct rb_node **node = &kn->parent->dir.children.rb_node; |
| 233 | struct rb_node *parent = NULL; | 233 | struct rb_node *parent = NULL; |
| 234 | 234 | ||
| 235 | if (kernfs_type(kn) == KERNFS_DIR) | ||
| 236 | kn->parent->dir.subdirs++; | ||
| 237 | |||
| 238 | while (*node) { | 235 | while (*node) { |
| 239 | struct kernfs_node *pos; | 236 | struct kernfs_node *pos; |
| 240 | int result; | 237 | int result; |
| @@ -249,9 +246,15 @@ static int kernfs_link_sibling(struct kernfs_node *kn) | |||
| 249 | else | 246 | else |
| 250 | return -EEXIST; | 247 | return -EEXIST; |
| 251 | } | 248 | } |
| 249 | |||
| 252 | /* add new node and rebalance the tree */ | 250 | /* add new node and rebalance the tree */ |
| 253 | rb_link_node(&kn->rb, parent, node); | 251 | rb_link_node(&kn->rb, parent, node); |
| 254 | rb_insert_color(&kn->rb, &kn->parent->dir.children); | 252 | rb_insert_color(&kn->rb, &kn->parent->dir.children); |
| 253 | |||
| 254 | /* successfully added, account subdir number */ | ||
| 255 | if (kernfs_type(kn) == KERNFS_DIR) | ||
| 256 | kn->parent->dir.subdirs++; | ||
| 257 | |||
| 255 | return 0; | 258 | return 0; |
| 256 | } | 259 | } |
| 257 | 260 | ||
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index 8034706a7af8..e01ea4a14a01 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c | |||
| @@ -484,6 +484,8 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 484 | 484 | ||
| 485 | ops = kernfs_ops(of->kn); | 485 | ops = kernfs_ops(of->kn); |
| 486 | rc = ops->mmap(of, vma); | 486 | rc = ops->mmap(of, vma); |
| 487 | if (rc) | ||
| 488 | goto out_put; | ||
| 487 | 489 | ||
| 488 | /* | 490 | /* |
| 489 | * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup() | 491 | * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup() |
