public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] udf: Fix to check the return value of load_nls
@ 2019-03-19  2:59 Aditya Pakki
  2019-03-19  8:52 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2019-03-19  2:59 UTC (permalink / raw)
  To: pakki001; +Cc: kjlu, Jan Kara, linux-kernel

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@umn.edu>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-19  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19  2:59 [PATCH] udf: Fix to check the return value of load_nls Aditya Pakki
2019-03-19  8:52 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox