qcacld-3.0: Check input parameters for tx_attr/rx_attr
In hdd_config_tx_rx_nss and hdd_config_vdev_chains, it missed to check if tx_attr or rx_attr is null, which will cause invalid memory access. Change-Id: Ic3427d714e240507cf4253588f706d06d355ba93 CRs-Fixed: 3086252
This commit is contained in:

کامیت شده توسط
Madan Koyyalamudi

والد
8a62e5dcd9
کامیت
765f3289a1
@@ -7853,6 +7853,13 @@ static int hdd_config_vdev_chains(struct hdd_adapter *adapter,
|
|||||||
if (!tx_attr && !rx_attr)
|
if (!tx_attr && !rx_attr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* if one is present, both must be present */
|
||||||
|
if (!tx_attr || !rx_attr) {
|
||||||
|
hdd_err("Missing attribute for %s",
|
||||||
|
tx_attr ? "RX" : "TX");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
tx_chains = nla_get_u8(tx_attr);
|
tx_chains = nla_get_u8(tx_attr);
|
||||||
rx_chains = nla_get_u8(rx_attr);
|
rx_chains = nla_get_u8(rx_attr);
|
||||||
|
|
||||||
@@ -7876,6 +7883,13 @@ static int hdd_config_tx_rx_nss(struct hdd_adapter *adapter,
|
|||||||
if (!tx_attr && !rx_attr)
|
if (!tx_attr && !rx_attr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* if one is present, both must be present */
|
||||||
|
if (!tx_attr || !rx_attr) {
|
||||||
|
hdd_err("Missing attribute for %s",
|
||||||
|
tx_attr ? "RX" : "TX");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
tx_nss = nla_get_u8(tx_attr);
|
tx_nss = nla_get_u8(tx_attr);
|
||||||
rx_nss = nla_get_u8(rx_attr);
|
rx_nss = nla_get_u8(rx_attr);
|
||||||
hdd_debug("tx_nss %d rx_nss %d", tx_nss, rx_nss);
|
hdd_debug("tx_nss %d rx_nss %d", tx_nss, rx_nss);
|
||||||
|
مرجع در شماره جدید
Block a user