diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
commit | af52739b922f656eb1f39016fabaabe4baeda2e2 (patch) | |
tree | 79a7aa810d0493cd0cf4adebac26d37f12e8b545 /drivers/mtd | |
parent | 25ed6a5e97809129a1bc852b6b5c7d03baa112c4 (diff) | |
parent | 33688abb2802ff3a230bd2441f765477b94cc89e (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')
-rw-r--r-- | drivers/mtd/ubi/build.c | 11 | ||||
-rw-r--r-- | drivers/mtd/ubi/kapi.c | 8 |
2 files changed, 16 insertions, 3 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 | */ |
1148 | static struct mtd_info * __init open_mtd_by_chdev(const char *mtd_dev) | 1148 | static 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, |
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 348dbbcbedc8..a9e2cef7c95c 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c | |||
@@ -302,6 +302,7 @@ EXPORT_SYMBOL_GPL(ubi_open_volume_nm); | |||
302 | struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode) | 302 | struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode) |
303 | { | 303 | { |
304 | int error, ubi_num, vol_id; | 304 | int error, ubi_num, vol_id; |
305 | struct path path; | ||
305 | struct kstat stat; | 306 | struct kstat stat; |
306 | 307 | ||
307 | dbg_gen("open volume %s, mode %d", pathname, mode); | 308 | dbg_gen("open volume %s, mode %d", pathname, mode); |
@@ -309,7 +310,12 @@ struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode) | |||
309 | if (!pathname || !*pathname) | 310 | if (!pathname || !*pathname) |
310 | return ERR_PTR(-EINVAL); | 311 | return ERR_PTR(-EINVAL); |
311 | 312 | ||
312 | error = vfs_stat(pathname, &stat); | 313 | error = kern_path(pathname, LOOKUP_FOLLOW, &path); |
314 | if (error) | ||
315 | return ERR_PTR(error); | ||
316 | |||
317 | error = vfs_getattr(&path, &stat); | ||
318 | path_put(&path); | ||
313 | if (error) | 319 | if (error) |
314 | return ERR_PTR(error); | 320 | return ERR_PTR(error); |
315 | 321 | ||