mirror of https://gitee.com/openkylin/linux.git
qed: Zero-out the buffer paased to dcbx_query() API
qed_dcbx_query_params() implementation populate the values to input buffer based on the dcbx mode and, the current negotiated state/params, the caller of this API need to memset the buffer to zero. Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ed0dd91515
commit
15c6de2c65
|
@ -1190,6 +1190,7 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,
|
|||
if (!dcbx_info)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(dcbx_info, 0, sizeof(*dcbx_info));
|
||||
rc = qed_dcbx_query_params(p_hwfn, dcbx_info, QED_DCBX_OPERATIONAL_MIB);
|
||||
if (rc) {
|
||||
kfree(dcbx_info);
|
||||
|
@ -1225,6 +1226,7 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,
|
|||
if (!dcbx_info)
|
||||
return NULL;
|
||||
|
||||
memset(dcbx_info, 0, sizeof(*dcbx_info));
|
||||
if (qed_dcbx_query_params(hwfn, dcbx_info, type)) {
|
||||
kfree(dcbx_info);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue