Commit d8e2f53a authored by Jeff Layton's avatar Jeff Layton Committed by 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: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 45d44740
...@@ -3976,9 +3976,8 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr, ...@@ -3976,9 +3976,8 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
max_len = data_end - temp; max_len = data_end - temp;
node->path_name = cifs_strndup_from_ucs(temp, max_len, node->path_name = cifs_strndup_from_ucs(temp, max_len,
is_unicode, nls_codepage); is_unicode, nls_codepage);
if (IS_ERR(node->path_name)) { if (!node->path_name) {
rc = PTR_ERR(node->path_name); rc = -ENOMEM;
node->path_name = NULL;
goto parse_DFS_referrals_exit; goto parse_DFS_referrals_exit;
} }
...@@ -3987,11 +3986,8 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr, ...@@ -3987,11 +3986,8 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
max_len = data_end - temp; max_len = data_end - temp;
node->node_name = cifs_strndup_from_ucs(temp, max_len, node->node_name = cifs_strndup_from_ucs(temp, max_len,
is_unicode, nls_codepage); is_unicode, nls_codepage);
if (IS_ERR(node->node_name)) { if (!node->node_name)
rc = PTR_ERR(node->node_name); rc = -ENOMEM;
node->node_name = NULL;
goto parse_DFS_referrals_exit;
}
} }
parse_DFS_referrals_exit: parse_DFS_referrals_exit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment