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

+9 -4
+1 -1
arch/s390/include/asm/ccwgroup.h
··· 22 /* public: */ 23 unsigned int count; 24 struct device dev; 25 - struct ccw_device *cdev[0]; 26 struct work_struct ungroup_work; 27 }; 28 29 /**
··· 22 /* public: */ 23 unsigned int count; 24 struct device dev; 25 struct work_struct ungroup_work; 26 + struct ccw_device *cdev[0]; 27 }; 28 29 /**
+6 -3
fs/kernfs/dir.c
··· 232 struct rb_node **node = &kn->parent->dir.children.rb_node; 233 struct rb_node *parent = NULL; 234 235 - if (kernfs_type(kn) == KERNFS_DIR) 236 - kn->parent->dir.subdirs++; 237 - 238 while (*node) { 239 struct kernfs_node *pos; 240 int result; ··· 246 else 247 return -EEXIST; 248 } 249 /* add new node and rebalance the tree */ 250 rb_link_node(&kn->rb, parent, node); 251 rb_insert_color(&kn->rb, &kn->parent->dir.children); 252 return 0; 253 } 254
··· 232 struct rb_node **node = &kn->parent->dir.children.rb_node; 233 struct rb_node *parent = NULL; 234 235 while (*node) { 236 struct kernfs_node *pos; 237 int result; ··· 249 else 250 return -EEXIST; 251 } 252 + 253 /* add new node and rebalance the tree */ 254 rb_link_node(&kn->rb, parent, node); 255 rb_insert_color(&kn->rb, &kn->parent->dir.children); 256 + 257 + /* successfully added, account subdir number */ 258 + if (kernfs_type(kn) == KERNFS_DIR) 259 + kn->parent->dir.subdirs++; 260 + 261 return 0; 262 } 263
+2
fs/kernfs/file.c
··· 484 485 ops = kernfs_ops(of->kn); 486 rc = ops->mmap(of, vma); 487 488 /* 489 * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup()
··· 484 485 ops = kernfs_ops(of->kn); 486 rc = ops->mmap(of, vma); 487 + if (rc) 488 + goto out_put; 489 490 /* 491 * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup()