diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-02-08 02:55:43 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-08 02:55:46 -0500 |
commit | 6d3e0907b8b239d16720d144e2675ecf10d3bc3b (patch) | |
tree | e0b0743b5f6f82b057cafc4f3687396a6e01a0b4 /drivers/mtd/ubi/kapi.c | |
parent | 23577256953c870de9b724c3a2611ce7be6a1e4e (diff) | |
parent | 50200df462023b187d80a99a52f5f2cfe3c86c26 (diff) |
Merge branch 'sched/urgent' into sched/core
Merge reason: Merge dependent fix, update to latest -rc.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/mtd/ubi/kapi.c')
-rw-r--r-- | drivers/mtd/ubi/kapi.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 277786ebaa2c..1361574e2b00 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c | |||
@@ -291,8 +291,7 @@ EXPORT_SYMBOL_GPL(ubi_open_volume_nm); | |||
291 | */ | 291 | */ |
292 | struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode) | 292 | struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode) |
293 | { | 293 | { |
294 | int error, ubi_num, vol_id; | 294 | int error, ubi_num, vol_id, mod; |
295 | struct ubi_volume_desc *ret; | ||
296 | struct inode *inode; | 295 | struct inode *inode; |
297 | struct path path; | 296 | struct path path; |
298 | 297 | ||
@@ -306,16 +305,16 @@ struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode) | |||
306 | return ERR_PTR(error); | 305 | return ERR_PTR(error); |
307 | 306 | ||
308 | inode = path.dentry->d_inode; | 307 | inode = path.dentry->d_inode; |
308 | mod = inode->i_mode; | ||
309 | ubi_num = ubi_major2num(imajor(inode)); | 309 | ubi_num = ubi_major2num(imajor(inode)); |
310 | vol_id = iminor(inode) - 1; | 310 | vol_id = iminor(inode) - 1; |
311 | path_put(&path); | ||
311 | 312 | ||
313 | if (!S_ISCHR(mod)) | ||
314 | return ERR_PTR(-EINVAL); | ||
312 | if (vol_id >= 0 && ubi_num >= 0) | 315 | if (vol_id >= 0 && ubi_num >= 0) |
313 | ret = ubi_open_volume(ubi_num, vol_id, mode); | 316 | return ubi_open_volume(ubi_num, vol_id, mode); |
314 | else | 317 | return ERR_PTR(-ENODEV); |
315 | ret = ERR_PTR(-ENODEV); | ||
316 | |||
317 | path_put(&path); | ||
318 | return ret; | ||
319 | } | 318 | } |
320 | EXPORT_SYMBOL_GPL(ubi_open_volume_path); | 319 | EXPORT_SYMBOL_GPL(ubi_open_volume_path); |
321 | 320 | ||