summaryrefslogtreecommitdiffstats
path: root/drivers/android/binderfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/android/binderfs.c')
-rw-r--r--drivers/android/binderfs.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c
index d8307cccbef8..55c5adb87585 100644
--- a/drivers/android/binderfs.c
+++ b/drivers/android/binderfs.c
@@ -186,8 +186,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode,
186 req->major = MAJOR(binderfs_dev); 186 req->major = MAJOR(binderfs_dev);
187 req->minor = minor; 187 req->minor = minor;
188 188
189 ret = copy_to_user(userp, req, sizeof(*req)); 189 if (userp && copy_to_user(userp, req, sizeof(*req))) {
190 if (ret) {
191 ret = -EFAULT; 190 ret = -EFAULT;
192 goto err; 191 goto err;
193 } 192 }
@@ -467,6 +466,9 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent)
467 int ret; 466 int ret;
468 struct binderfs_info *info; 467 struct binderfs_info *info;
469 struct inode *inode = NULL; 468 struct inode *inode = NULL;
469 struct binderfs_device device_info = { 0 };
470 const char *name;
471 size_t len;
470 472
471 sb->s_blocksize = PAGE_SIZE; 473 sb->s_blocksize = PAGE_SIZE;
472 sb->s_blocksize_bits = PAGE_SHIFT; 474 sb->s_blocksize_bits = PAGE_SHIFT;
@@ -521,7 +523,22 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent)
521 if (!sb->s_root) 523 if (!sb->s_root)
522 return -ENOMEM; 524 return -ENOMEM;
523 525
524 return binderfs_binder_ctl_create(sb); 526 ret = binderfs_binder_ctl_create(sb);
527 if (ret)
528 return ret;
529
530 name = binder_devices_param;
531 for (len = strcspn(name, ","); len > 0; len = strcspn(name, ",")) {
532 strscpy(device_info.name, name, len + 1);
533 ret = binderfs_binder_device_create(inode, NULL, &device_info);
534 if (ret)
535 return ret;
536 name += len;
537 if (*name == ',')
538 name++;
539 }
540
541 return 0;
525} 542}
526 543
527static struct dentry *binderfs_mount(struct file_system_type *fs_type, 544static struct dentry *binderfs_mount(struct file_system_type *fs_type,