aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/build.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-20 11:25:44 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-20 11:25:44 -0400
commitaf52739b922f656eb1f39016fabaabe4baeda2e2 (patch)
tree79a7aa810d0493cd0cf4adebac26d37f12e8b545 /drivers/mtd/ubi/build.c
parent25ed6a5e97809129a1bc852b6b5c7d03baa112c4 (diff)
parent33688abb2802ff3a230bd2441f765477b94cc89e (diff)
Merge 4.7-rc4 into staging-next
We want the fixes in here, and we can resolve a merge issue in drivers/iio/industrialio-trigger.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mtd/ubi/build.c')
-rw-r--r--drivers/mtd/ubi/build.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 16baeb51b2bd..ef3618299494 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1147,11 +1147,17 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
1147 */ 1147 */
1148static struct mtd_info * __init open_mtd_by_chdev(const char *mtd_dev) 1148static struct mtd_info * __init open_mtd_by_chdev(const char *mtd_dev)
1149{ 1149{
1150 struct kstat stat;
1151 int err, minor; 1150 int err, minor;
1151 struct path path;
1152 struct kstat stat;
1152 1153
1153 /* Probably this is an MTD character device node path */ 1154 /* Probably this is an MTD character device node path */
1154 err = vfs_stat(mtd_dev, &stat); 1155 err = kern_path(mtd_dev, LOOKUP_FOLLOW, &path);
1156 if (err)
1157 return ERR_PTR(err);
1158
1159 err = vfs_getattr(&path, &stat);
1160 path_put(&path);
1155 if (err) 1161 if (err)
1156 return ERR_PTR(err); 1162 return ERR_PTR(err);
1157 1163
@@ -1160,6 +1166,7 @@ static struct mtd_info * __init open_mtd_by_chdev(const char *mtd_dev)
1160 return ERR_PTR(-EINVAL); 1166 return ERR_PTR(-EINVAL);
1161 1167
1162 minor = MINOR(stat.rdev); 1168 minor = MINOR(stat.rdev);
1169
1163 if (minor & 1) 1170 if (minor & 1)
1164 /* 1171 /*
1165 * Just do not think the "/dev/mtdrX" devices support is need, 1172 * Just do not think the "/dev/mtdrX" devices support is need,