[PATCH] udf: Fix to check the return value of load_nls

From: Aditya Pakki
Date: Mon Mar 18 2019 - 22:59:57 EST


load_nls may fail and return an error message. The patch checks
for such a scenario and passes the error upstream.

Signed-off-by: Aditya Pakki <pakki001@xxxxxxx>
---
fs/udf/super.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/udf/super.c b/fs/udf/super.c
index ffd8038ff728..1a38271de6d9 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -573,6 +573,8 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
if (uopt->nls_map)
unload_nls(uopt->nls_map);
uopt->nls_map = load_nls(args[0].from);
+ if (!uopt->nls_map)
+ return 0;
uopt->flags |= (1 << UDF_FLAG_NLS_MAP);
}
break;
--
2.17.1