Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179949
b: refs/heads/master
c: b531b55
h: refs/heads/master
i:
  179947: 6644a16
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jan 12, 2010
1 parent 603e2b1 commit 9dbaef4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff998793288b49a3b22d929bf8e56362320905ff
refs/heads/master: b531b55a7bde8aa2bdf7023b3afc6df1bf3dcb67
15 changes: 7 additions & 8 deletions trunk/drivers/mtd/ubi/kapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,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 ubi_volume_desc *ret;
int error, ubi_num, vol_id, mod;
struct inode *inode;
struct path path;

Expand All @@ -306,16 +305,16 @@ struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode)
return ERR_PTR(error);

inode = path.dentry->d_inode;
mod = inode->i_mode;
ubi_num = ubi_major2num(imajor(inode));
vol_id = iminor(inode) - 1;
path_put(&path);

if (!S_ISCHR(mod))
return ERR_PTR(-EINVAL);
if (vol_id >= 0 && ubi_num >= 0)
ret = ubi_open_volume(ubi_num, vol_id, mode);
else
ret = ERR_PTR(-ENODEV);

path_put(&path);
return ret;
return ubi_open_volume(ubi_num, vol_id, mode);
return ERR_PTR(-ENODEV);
}
EXPORT_SYMBOL_GPL(ubi_open_volume_path);

Expand Down

0 comments on commit 9dbaef4

Please sign in to comment.