File tree 2 files changed +12
-22
lines changed
2 files changed +12
-22
lines changed Original file line number Diff line number Diff line change @@ -188,4 +188,11 @@ static inline void dfs_put_root_smb_sessions(struct list_head *head)
188
188
}
189
189
}
190
190
191
+ static inline const char * dfs_ses_refpath (struct cifs_ses * ses )
192
+ {
193
+ const char * path = ses -> server -> leaf_fullpath ;
194
+
195
+ return path ? path + 1 : ERR_PTR (- ENOENT );
196
+ }
197
+
191
198
#endif /* _CIFS_DFS_H */
Original file line number Diff line number Diff line change @@ -1136,33 +1136,19 @@ static bool is_ses_good(struct cifs_ses *ses)
1136
1136
return ret ;
1137
1137
}
1138
1138
1139
- static char * get_ses_refpath (struct cifs_ses * ses )
1140
- {
1141
- struct TCP_Server_Info * server = ses -> server ;
1142
- char * path = ERR_PTR (- ENOENT );
1143
-
1144
- if (server -> leaf_fullpath ) {
1145
- path = kstrdup (server -> leaf_fullpath + 1 , GFP_KERNEL );
1146
- if (!path )
1147
- path = ERR_PTR (- ENOMEM );
1148
- }
1149
- return path ;
1150
- }
1151
-
1152
1139
/* Refresh dfs referral of @ses */
1153
1140
static void refresh_ses_referral (struct cifs_ses * ses )
1154
1141
{
1155
1142
struct cache_entry * ce ;
1156
1143
unsigned int xid ;
1157
- char * path ;
1144
+ const char * path ;
1158
1145
int rc = 0 ;
1159
1146
1160
1147
xid = get_xid ();
1161
1148
1162
- path = get_ses_refpath (ses );
1149
+ path = dfs_ses_refpath (ses );
1163
1150
if (IS_ERR (path )) {
1164
1151
rc = PTR_ERR (path );
1165
- path = NULL ;
1166
1152
goto out ;
1167
1153
}
1168
1154
@@ -1181,7 +1167,6 @@ static void refresh_ses_referral(struct cifs_ses *ses)
1181
1167
1182
1168
out :
1183
1169
free_xid (xid );
1184
- kfree (path );
1185
1170
}
1186
1171
1187
1172
static int __refresh_tcon_referral (struct cifs_tcon * tcon ,
@@ -1231,19 +1216,18 @@ static void refresh_tcon_referral(struct cifs_tcon *tcon, bool force_refresh)
1231
1216
struct dfs_info3_param * refs = NULL ;
1232
1217
struct cache_entry * ce ;
1233
1218
struct cifs_ses * ses ;
1234
- unsigned int xid ;
1235
1219
bool needs_refresh ;
1236
- char * path ;
1220
+ const char * path ;
1221
+ unsigned int xid ;
1237
1222
int numrefs = 0 ;
1238
1223
int rc = 0 ;
1239
1224
1240
1225
xid = get_xid ();
1241
1226
ses = tcon -> ses ;
1242
1227
1243
- path = get_ses_refpath (ses );
1228
+ path = dfs_ses_refpath (ses );
1244
1229
if (IS_ERR (path )) {
1245
1230
rc = PTR_ERR (path );
1246
- path = NULL ;
1247
1231
goto out ;
1248
1232
}
1249
1233
@@ -1271,7 +1255,6 @@ static void refresh_tcon_referral(struct cifs_tcon *tcon, bool force_refresh)
1271
1255
1272
1256
out :
1273
1257
free_xid (xid );
1274
- kfree (path );
1275
1258
free_dfs_info_array (refs , numrefs );
1276
1259
}
1277
1260
You can’t perform that action at this time.
0 commit comments