diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-05-14 13:46:59 +0200 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-05-14 15:55:32 +0200 |
commit | d8e2f53ac99f4ce7d63807a84f98d1b80df598cf (patch) | |
tree | 2b956d4bf048e9b72b99a84f589baedbdf6f757c | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6 (diff) | |
download | linux-d8e2f53ac99f4ce7d63807a84f98d1b80df598cf.tar.xz linux-d8e2f53ac99f4ce7d63807a84f98d1b80df598cf.zip |
cifs: fix error handling in parse_DFS_referrals
cifs_strndup_from_ucs returns NULL on error, not an ERR_PTR
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r-- | fs/cifs/cifssmb.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 75e6623a8635..5759ba53dc96 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -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: |