Explorar o código

[CIFS] Fix mem leak on dfs referral

Signed-off-by: Igor Mammedov <niallain@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Steve French %!s(int64=17) %!d(string=hai) anos
pai
achega
04b6e6ec1a
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      fs/cifs/inode.c

+ 8 - 2
fs/cifs/inode.c

@@ -211,7 +211,10 @@ try_again_CIFSSMBUnixQPathInfo:
 	if (rc) {
 		if (rc == -EREMOTE && !is_dfs_referral) {
 			is_dfs_referral = true;
-			full_path = search_path;
+			if (full_path != search_path) {
+				kfree(full_path);
+				full_path = search_path;
+			}
 			goto try_again_CIFSSMBUnixQPathInfo;
 		}
 		goto cgiiu_exit;
@@ -422,7 +425,10 @@ try_again_CIFSSMBQPathInfo:
 	if (rc) {
 		if (rc == -EREMOTE && !is_dfs_referral) {
 			is_dfs_referral = true;
-			full_path = search_path;
+			if (full_path != search_path) {
+				kfree(full_path);
+				full_path = search_path;
+			}
 			goto try_again_CIFSSMBQPathInfo;
 		}
 		goto cgii_exit;