qcacld-3.0: Fix logging issue in NL80211_RATE_INFO_BITRATE32
Even though the bitrate is greater than zero, because of incorrect conditional check, error log "Invalid bitrate" is getting printed. Hence, fix this by adding proper conditional check. Change-Id: I2076c7a90e735e4a278f4d5894e51abc8bd091c0 CRs-Fixed: 2250687
This commit is contained in:

committed by
nshrivas

parent
ccc6906dbf
commit
27cdaa15fb
@@ -4619,18 +4619,21 @@ static int32_t hdd_add_tx_bitrate(struct sk_buff *skb,
|
|||||||
/* report 16-bit bitrate only if we can */
|
/* report 16-bit bitrate only if we can */
|
||||||
bitrate_compat = bitrate < (1UL << 16) ? bitrate : 0;
|
bitrate_compat = bitrate < (1UL << 16) ? bitrate : 0;
|
||||||
|
|
||||||
if (bitrate > 0 &&
|
if (bitrate > 0) {
|
||||||
nla_put_u32(skb, NL80211_RATE_INFO_BITRATE32, bitrate)) {
|
if (nla_put_u32(skb, NL80211_RATE_INFO_BITRATE32, bitrate)) {
|
||||||
hdd_err("put fail bitrate: %u", bitrate);
|
hdd_err("put fail bitrate: %u", bitrate);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
hdd_err("Invalid bitrate: %u", bitrate);
|
hdd_err("Invalid bitrate: %u", bitrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bitrate_compat > 0 &&
|
if (bitrate_compat > 0) {
|
||||||
nla_put_u16(skb, NL80211_RATE_INFO_BITRATE, bitrate_compat)) {
|
if (nla_put_u16(skb, NL80211_RATE_INFO_BITRATE,
|
||||||
hdd_err("put fail");
|
bitrate_compat)) {
|
||||||
goto fail;
|
hdd_err("put fail bitrate_compat: %u", bitrate_compat);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
hdd_err("Invalid bitrate_compat: %u", bitrate_compat);
|
hdd_err("Invalid bitrate_compat: %u", bitrate_compat);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user