@@ -1451,6 +1451,7 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
1451
1451
__u8 oplock = SMB2_OPLOCK_LEVEL_NONE ;
1452
1452
struct cifs_open_parms oparms ;
1453
1453
struct cifs_fid fid ;
1454
+ struct kvec err_iov = {NULL , 0 };
1454
1455
struct smb2_err_rsp * err_buf = NULL ;
1455
1456
struct smb2_symlink_err_rsp * symlink ;
1456
1457
unsigned int sub_len ;
@@ -1473,15 +1474,16 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
1473
1474
oparms .fid = & fid ;
1474
1475
oparms .reconnect = false;
1475
1476
1476
- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , & err_buf );
1477
+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , & err_iov );
1477
1478
1478
1479
if (!rc || !err_buf ) {
1479
1480
kfree (utf16_path );
1480
1481
return - ENOENT ;
1481
1482
}
1482
1483
1484
+ err_buf = err_iov .iov_base ;
1483
1485
if (le32_to_cpu (err_buf -> ByteCount ) < sizeof (struct smb2_symlink_err_rsp ) ||
1484
- get_rfc1002_length ( err_buf ) + server -> vals -> header_preamble_size < SMB2_SYMLINK_STRUCT_SIZE ) {
1486
+ err_iov . iov_len + server -> vals -> header_preamble_size < SMB2_SYMLINK_STRUCT_SIZE ) {
1485
1487
kfree (utf16_path );
1486
1488
return - ENOENT ;
1487
1489
}
@@ -1494,13 +1496,13 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
1494
1496
print_len = le16_to_cpu (symlink -> PrintNameLength );
1495
1497
print_offset = le16_to_cpu (symlink -> PrintNameOffset );
1496
1498
1497
- if (get_rfc1002_length ( err_buf ) + server -> vals -> header_preamble_size <
1499
+ if (err_iov . iov_len + server -> vals -> header_preamble_size <
1498
1500
SMB2_SYMLINK_STRUCT_SIZE + sub_offset + sub_len ) {
1499
1501
kfree (utf16_path );
1500
1502
return - ENOENT ;
1501
1503
}
1502
1504
1503
- if (get_rfc1002_length ( err_buf ) + server -> vals -> header_preamble_size <
1505
+ if (err_iov . iov_len + server -> vals -> header_preamble_size <
1504
1506
SMB2_SYMLINK_STRUCT_SIZE + print_offset + print_len ) {
1505
1507
kfree (utf16_path );
1506
1508
return - ENOENT ;
0 commit comments