提交 d8e2f53a 编写于 作者: J Jeff Layton 提交者: Steve French

cifs: fix error handling in parse_DFS_referrals

cifs_strndup_from_ucs returns NULL on error, not an ERR_PTR
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 45d44740
......@@ -3976,9 +3976,8 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
max_len = data_end - temp;
node->path_name = cifs_strndup_from_ucs(temp, max_len,
is_unicode, nls_codepage);
if (IS_ERR(node->path_name)) {
rc = PTR_ERR(node->path_name);
node->path_name = NULL;
if (!node->path_name) {
rc = -ENOMEM;
goto parse_DFS_referrals_exit;
}
......@@ -3987,11 +3986,8 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
max_len = data_end - temp;
node->node_name = cifs_strndup_from_ucs(temp, max_len,
is_unicode, nls_codepage);
if (IS_ERR(node->node_name)) {
rc = PTR_ERR(node->node_name);
node->node_name = NULL;
goto parse_DFS_referrals_exit;
}
if (!node->node_name)
rc = -ENOMEM;
}
parse_DFS_referrals_exit:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册