diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-11-20 11:14:20 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-12-16 22:45:04 +0100 |
commit | 97cb69dd800a471c3ee2467be3826badd9c12883 (patch) | |
tree | 516f985ee156043e403987da369f9dbc724f467a /drivers/mtd/mtdchar.c | |
parent | Linux 4.4-rc5 (diff) | |
download | linux-97cb69dd800a471c3ee2467be3826badd9c12883.tar.xz linux-97cb69dd800a471c3ee2467be3826badd9c12883.zip |
UBI: fix return error code
We are checking dfs_rootdir for error value or NULL. But in the
conditional ternary operator we returned -ENODEV if dfs_rootdir contains
an error value and returned PTR_ERR(dfs_rootdir) if dfs_rootdir is NULL.
So in the case of dfs_rootdir being NULL we actually assigned 0 to err
and returned it to the caller implying a success.
Lets return -ENODEV when dfs_rootdir is NULL else return
PTR_ERR(dfs_rootdir).
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/mtdchar.c')
0 files changed, 0 insertions, 0 deletions