@@ -348,7 +348,7 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid)
348
348
oparams .fid = pfid ;
349
349
oparams .reconnect = false;
350
350
351
- rc = SMB2_open (xid , & oparams , & srch_path , & oplock , NULL , NULL );
351
+ rc = SMB2_open (xid , & oparams , & srch_path , & oplock , NULL , NULL , NULL );
352
352
if (rc == 0 ) {
353
353
memcpy (tcon -> prfid , pfid , sizeof (struct cifs_fid ));
354
354
tcon -> valid_root_fid = true;
@@ -375,7 +375,8 @@ smb3_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon)
375
375
oparms .reconnect = false;
376
376
377
377
if (no_cached_open )
378
- rc = SMB2_open (xid , & oparms , & srch_path , & oplock , NULL , NULL );
378
+ rc = SMB2_open (xid , & oparms , & srch_path , & oplock , NULL , NULL ,
379
+ NULL );
379
380
else
380
381
rc = open_shroot (xid , tcon , & fid );
381
382
@@ -413,7 +414,7 @@ smb2_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon)
413
414
oparms .fid = & fid ;
414
415
oparms .reconnect = false;
415
416
416
- rc = SMB2_open (xid , & oparms , & srch_path , & oplock , NULL , NULL );
417
+ rc = SMB2_open (xid , & oparms , & srch_path , & oplock , NULL , NULL , NULL );
417
418
if (rc )
418
419
return ;
419
420
@@ -449,7 +450,7 @@ smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
449
450
oparms .fid = & fid ;
450
451
oparms .reconnect = false;
451
452
452
- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL );
453
+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL , NULL );
453
454
if (rc ) {
454
455
kfree (utf16_path );
455
456
return rc ;
@@ -598,7 +599,7 @@ smb2_query_eas(const unsigned int xid, struct cifs_tcon *tcon,
598
599
oparms .fid = & fid ;
599
600
oparms .reconnect = false;
600
601
601
- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL );
602
+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL , NULL );
602
603
kfree (utf16_path );
603
604
if (rc ) {
604
605
cifs_dbg (FYI , "open failed rc=%d\n" , rc );
@@ -677,7 +678,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
677
678
oparms .fid = & fid ;
678
679
oparms .reconnect = false;
679
680
680
- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL );
681
+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL , NULL );
681
682
kfree (utf16_path );
682
683
if (rc ) {
683
684
cifs_dbg (FYI , "open failed rc=%d\n" , rc );
@@ -1261,7 +1262,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
1261
1262
oparms .fid = fid ;
1262
1263
oparms .reconnect = false;
1263
1264
1264
- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL );
1265
+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL , NULL );
1265
1266
kfree (utf16_path );
1266
1267
if (rc ) {
1267
1268
cifs_dbg (FYI , "open dir failed rc=%d\n" , rc );
@@ -1361,7 +1362,7 @@ smb2_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
1361
1362
oparms .fid = & fid ;
1362
1363
oparms .reconnect = false;
1363
1364
1364
- rc = SMB2_open (xid , & oparms , & srch_path , & oplock , NULL , NULL );
1365
+ rc = SMB2_open (xid , & oparms , & srch_path , & oplock , NULL , NULL , NULL );
1365
1366
if (rc )
1366
1367
return rc ;
1367
1368
buf -> f_type = SMB2_MAGIC_NUMBER ;
@@ -1515,7 +1516,8 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
1515
1516
struct cifs_open_parms oparms ;
1516
1517
struct cifs_fid fid ;
1517
1518
struct kvec err_iov = {NULL , 0 };
1518
- struct smb2_err_rsp * err_buf ;
1519
+ struct smb2_err_rsp * err_buf = NULL ;
1520
+ int resp_buftype ;
1519
1521
struct smb2_symlink_err_rsp * symlink ;
1520
1522
unsigned int sub_len ;
1521
1523
unsigned int sub_offset ;
@@ -1535,18 +1537,18 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
1535
1537
oparms .fid = & fid ;
1536
1538
oparms .reconnect = false;
1537
1539
1538
- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , & err_iov );
1539
-
1540
+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , & err_iov ,
1541
+ & resp_buftype );
1540
1542
if (!rc || !err_iov .iov_base ) {
1541
- kfree ( utf16_path ) ;
1542
- return - ENOENT ;
1543
+ rc = - ENOENT ;
1544
+ goto querty_exit ;
1543
1545
}
1544
1546
1545
1547
err_buf = err_iov .iov_base ;
1546
1548
if (le32_to_cpu (err_buf -> ByteCount ) < sizeof (struct smb2_symlink_err_rsp ) ||
1547
1549
err_iov .iov_len < SMB2_SYMLINK_STRUCT_SIZE ) {
1548
- kfree ( utf16_path ) ;
1549
- return - ENOENT ;
1550
+ rc = - ENOENT ;
1551
+ goto querty_exit ;
1550
1552
}
1551
1553
1552
1554
/* open must fail on symlink - reset rc */
@@ -1558,25 +1560,28 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
1558
1560
print_offset = le16_to_cpu (symlink -> PrintNameOffset );
1559
1561
1560
1562
if (err_iov .iov_len < SMB2_SYMLINK_STRUCT_SIZE + sub_offset + sub_len ) {
1561
- kfree ( utf16_path ) ;
1562
- return - ENOENT ;
1563
+ rc = - ENOENT ;
1564
+ goto querty_exit ;
1563
1565
}
1564
1566
1565
1567
if (err_iov .iov_len <
1566
1568
SMB2_SYMLINK_STRUCT_SIZE + print_offset + print_len ) {
1567
- kfree ( utf16_path ) ;
1568
- return - ENOENT ;
1569
+ rc = - ENOENT ;
1570
+ goto querty_exit ;
1569
1571
}
1570
1572
1571
1573
* target_path = cifs_strndup_from_utf16 (
1572
1574
(char * )symlink -> PathBuffer + sub_offset ,
1573
1575
sub_len , true, cifs_sb -> local_nls );
1574
1576
if (!(* target_path )) {
1575
- kfree ( utf16_path ) ;
1576
- return - ENOMEM ;
1577
+ rc = - ENOMEM ;
1578
+ goto querty_exit ;
1577
1579
}
1578
1580
convert_delimiter (* target_path , '/' );
1579
1581
cifs_dbg (FYI , "%s: target path: %s\n" , __func__ , * target_path );
1582
+
1583
+ querty_exit :
1584
+ free_rsp_buf (resp_buftype , err_buf );
1580
1585
kfree (utf16_path );
1581
1586
return rc ;
1582
1587
}
@@ -1649,7 +1654,7 @@ get_smb2_acl_by_path(struct cifs_sb_info *cifs_sb,
1649
1654
oparms .fid = & fid ;
1650
1655
oparms .reconnect = false;
1651
1656
1652
- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL );
1657
+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL , NULL );
1653
1658
kfree (utf16_path );
1654
1659
if (!rc ) {
1655
1660
rc = SMB2_query_acl (xid , tlink_tcon (tlink ), fid .persistent_fid ,
@@ -1712,7 +1717,7 @@ set_smb2_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
1712
1717
oparms .fid = & fid ;
1713
1718
oparms .reconnect = false;
1714
1719
1715
- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL );
1720
+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , NULL , NULL );
1716
1721
kfree (utf16_path );
1717
1722
if (!rc ) {
1718
1723
rc = SMB2_set_acl (xid , tlink_tcon (tlink ), fid .persistent_fid ,
0 commit comments