two client memory leak fixes

-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmmCje0ACgkQiiy9cAdy
 T1HxQAv/TjRhKJFinyDRJZ84wmsJsfc8X0qvbwmkHH0rHdZYql7hmgPFKzrU5NBc
 NL+tV8fKtmNT1cZAuylsDI55q/HAkC+rR9rmyn8RbwYr8MO8hJx8uDr+SkxN2o6+
 5nc98r3wNtKg39O9XavTjPL9zuz2VlymAcbQsV+oYgz7mwD6F54W2z+Y34NWuDb4
 R4iTFF0HQ7ErRqjtlYPizlBA3JE1f0bgrBGqfoBb7J+qGRTdGe4GhBP/Gy5Xld42
 gyz2avnPKR16vzKAXvvmw6LID14IMBRf0LH3YGzqXyCWvKnezI6NRbX7DzlRZNYV
 0uxM8Fl2KaZ4q38X7kW51DGHXbHqrbfUtiDVT8kkb3xHuuX2hD+mVmnfsc98IRQY
 +EwTuHq0sjlyKi3QTkfalil+2YzjEHxUzx0Gww2noPFR5JLzb+aRPbFBHkqYGnyq
 oKkr9hiROu65lzlidSYB98e6axlrpHGKdQUL7kzp+5JRsDrqCAnFgbNIPYLG7gRm
 Al7UeKD0
 =Ifd/
 -----END PGP SIGNATURE-----

Merge tag 'v6.19rc8-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:
 "Two small client memory leak fixes"

* tag 'v6.19rc8-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  smb/client: fix memory leak in SendReceive()
  smb/client: fix memory leak in smb2_open_file()
This commit is contained in:
Linus Torvalds 2026-02-03 16:20:59 -08:00
commit 5fd0a1df5d
2 changed files with 4 additions and 1 deletions

View file

@ -251,13 +251,15 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
rc = cifs_send_recv(xid, ses, ses->server,
&rqst, &resp_buf_type, flags, &resp_iov);
if (rc < 0)
return rc;
goto out;
if (out_buf) {
*pbytes_returned = resp_iov.iov_len;
if (resp_iov.iov_len)
memcpy(out_buf, resp_iov.iov_base, resp_iov.iov_len);
}
out:
free_rsp_buf(resp_buf_type, resp_iov.iov_base);
return rc;
}

View file

@ -178,6 +178,7 @@ int smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms,
rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, &err_iov,
&err_buftype);
if (rc == -EACCES && retry_without_read_attributes) {
free_rsp_buf(err_buftype, err_iov.iov_base);
oparms->desired_access &= ~FILE_READ_ATTRIBUTES;
rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, &err_iov,
&err_buftype);