ANDROID: sdcardfs: Use to kstrout
authorDaniel Rosenberg <drosen@google.com>
Fri, 17 Mar 2017 02:32:59 +0000 (19:32 -0700)
committerStricted <info@stricted.net>
Thu, 11 Oct 2018 16:03:33 +0000 (18:03 +0200)
Switch from deprecated simple_strtoul to kstrout

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 35331000
Change-Id: If18bd133b4d2877f71e58b58fc31371ff6613ed5

fs/sdcardfs/derived_perm.c

index 78f0d2e29c7d33f18c4805ead5b437928513318f..668b83f1c1dbe0244ebef9febb0d1f812549c3d4 100644 (file)
@@ -60,6 +60,8 @@ void get_derived_permission_new(struct dentry *parent, struct dentry *dentry,
        struct sdcardfs_inode_info *info = SDCARDFS_I(dentry->d_inode);
        struct sdcardfs_inode_info *parent_info = SDCARDFS_I(parent->d_inode);
        appid_t appid;
+       unsigned long user_num;
+       int err;
        struct qstr q_Android = QSTR_LITERAL("Android");
        struct qstr q_data = QSTR_LITERAL("data");
        struct qstr q_obb = QSTR_LITERAL("obb");
@@ -88,7 +90,11 @@ void get_derived_permission_new(struct dentry *parent, struct dentry *dentry,
        case PERM_PRE_ROOT:
                /* Legacy internal layout places users at top level */
                info->perm = PERM_ROOT;
-               info->userid = simple_strtoul(name->name, NULL, 10);
+               err = kstrtoul(name->name, 10, &user_num);
+               if (err)
+                       info->userid = 0;
+               else
+                       info->userid = user_num;
                set_top(info, &info->vfs_inode);
                break;
        case PERM_ROOT: