summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/kapi.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-07-25 22:50:36 +0200
committerKees Cook <keescook@chromium.org>2016-07-25 22:50:36 +0200
commit74e630a7582e6b3cb39559d712a0049f08dea8a0 (patch)
tree98a752412dcfc74d802024c1d9e8c541b93174f9 /drivers/mtd/ubi/kapi.c
parentpstore/ram: add Device Tree bindings (diff)
parentLinux 4.7 (diff)
downloadlinux-74e630a7582e6b3cb39559d712a0049f08dea8a0.tar.xz
linux-74e630a7582e6b3cb39559d712a0049f08dea8a0.zip
Merge tag 'v4.7' into for-linus/pstore
Linux 4.7
Diffstat (limited to 'drivers/mtd/ubi/kapi.c')
-rw-r--r--drivers/mtd/ubi/kapi.c8
1 files changed, 7 insertions, 1 deletions
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);
struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode)
{
int error, ubi_num, vol_id;
+ struct path path;
struct kstat stat;
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)
if (!pathname || !*pathname)
return ERR_PTR(-EINVAL);
- error = vfs_stat(pathname, &stat);
+ error = kern_path(pathname, LOOKUP_FOLLOW, &path);
+ if (error)
+ return ERR_PTR(error);
+
+ error = vfs_getattr(&path, &stat);
+ path_put(&path);
if (error)
return ERR_PTR(error);