commit
f74bc7c6679200a4a83156bb89cbf6c229fe8ec0 upstream.
And fix tcon leak in error path.
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
[bwh: Backported to 3.2: cifs_tcon pointer is tcon, and there's no leak to fix]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
oplock = pTcon->ses->server->oplocks ? REQ_OPLOCK : 0;
/* Don't allow path components longer than the server max. */
- if (unlikely(direntry->d_name.len >
+ if (unlikely(pTcon->fsAttrInfo.MaxPathNameComponentLength &&
+ direntry->d_name.len >
le32_to_cpu(pTcon->fsAttrInfo.MaxPathNameComponentLength))) {
rc = -ENAMETOOLONG;
goto lookup_out;