diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c index b0ddcaa2d815..c292e3cd623b 100644 --- a/fs/smb/client/dir.c +++ b/fs/smb/client/dir.c @@ -115,11 +115,7 @@ char *__build_path_from_dentry_optional_prefix(struct dentry *direntry, void *pa } if (dirsep != '/') { /* BB test paths to Windows with '/' in the midst of prepath */ - char *p; - - for (p = s; *p; p++) - if (*p == '/') - *p = dirsep; + strreplace(s, '/', dirsep); } if (dfsplen) { s -= dfsplen;