mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-02 12:20:51 +00:00
NTB: MFV cc0f868d: fix pointer math issues
->remote_rx_info and ->rx_info are struct ntb_rx_info pointers. If we add sizeof(struct ntb_rx_info) then it goes too far. Authored by: Dan Carpenter Obtained from: Linux Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
dfff069863
commit
262d9f674f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=289152
@ -548,7 +548,7 @@ ntb_transport_init_queue(struct ntb_netdev *nt, unsigned int qp_num)
|
||||
(qp_num / NTB_NUM_MW * tx_size));
|
||||
tx_size -= sizeof(struct ntb_rx_info);
|
||||
|
||||
qp->tx_mw = qp->rx_info + sizeof(struct ntb_rx_info);
|
||||
qp->tx_mw = qp->rx_info + 1;
|
||||
qp->tx_max_frame = min(transport_mtu + sizeof(struct ntb_payload_header),
|
||||
tx_size);
|
||||
qp->tx_max_entry = tx_size / qp->tx_max_frame;
|
||||
@ -1148,7 +1148,7 @@ ntb_transport_setup_qp_mw(struct ntb_netdev *nt, unsigned int qp_num)
|
||||
(qp_num / NTB_NUM_MW * rx_size));
|
||||
rx_size -= sizeof(struct ntb_rx_info);
|
||||
|
||||
qp->rx_buff = qp->remote_rx_info + sizeof(struct ntb_rx_info);
|
||||
qp->rx_buff = qp->remote_rx_info + 1;
|
||||
qp->rx_max_frame = min(transport_mtu + sizeof(struct ntb_payload_header),
|
||||
rx_size);
|
||||
qp->rx_max_entry = rx_size / qp->rx_max_frame;
|
||||
|
Loading…
Reference in New Issue
Block a user