]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
UBI: fix return error code
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Fri, 20 Nov 2015 10:14:20 +0000 (15:44 +0530)
committerRichard Weinberger <richard@nod.at>
Wed, 16 Dec 2015 21:45:04 +0000 (22:45 +0100)
commit97cb69dd800a471c3ee2467be3826badd9c12883
tree516f985ee156043e403987da369f9dbc724f467a
parent9f9499ae8e6415cefc4fe0a96ad0e27864353c89
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>
drivers/mtd/ubi/debug.c