提交 5d7fe4ef 编写于 作者: M Mike Marciniszyn 提交者: Roland Dreier

IB/qib: Fix size of cc_supported_table_entries

Commit 36a8f01c ("IB/qib: Add congestion control agent
implementation") tries to store the value 1984 in a u8, which leads to
truncation.  Fix this by making the member big enough.

This bug was detected by a smatch warning.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NRamkrishna Vepa <ramkrishna.vepa@intel.com>
Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 5dedb9f3
......@@ -656,6 +656,11 @@ struct qib_pportdata {
/* 16 congestion entries with each entry corresponding to a SL */
struct ib_cc_congestion_entry_shadow *congestion_entries;
/* Maximum number of congestion control entries that the agent expects
* the manager to send.
*/
u16 cc_supported_table_entries;
/* Total number of congestion control table entries */
u16 total_cct_entry;
......@@ -667,11 +672,6 @@ struct qib_pportdata {
/* CA's max number of 64 entry units in the congestion control table */
u8 cc_max_table_entries;
/* Maximum number of congestion control entries that the agent expects
* the manager to send.
*/
u8 cc_supported_table_entries;
};
/* Observers. Not to be taken lightly, possibly not to ship. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册