提交 a5a7103f 编写于 作者: F Felix Fietkau 提交者: John W. Linville

p54: fix a NULL pointer dereference bug

If the RSSI calibration table was not found or not parsed properly,
priv->rssi_db will be NULL, p54_rssi_find needs to be able to deal
with that.
Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
Acked-by: NChristian Lamparter <chunkeey@googlemail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 c2a7dca0
......@@ -524,10 +524,13 @@ static int p54_parse_rssical(struct ieee80211_hw *dev,
struct p54_rssi_db_entry *p54_rssi_find(struct p54_common *priv, const u16 freq)
{
struct p54_rssi_db_entry *entry = (void *)(priv->rssi_db->data +
priv->rssi_db->offset);
struct p54_rssi_db_entry *entry;
int i, found = -1;
if (!priv->rssi_db)
return &p54_rssi_default;
entry = (void *)(priv->rssi_db->data + priv->rssi_db->offset);
for (i = 0; i < priv->rssi_db->entries; i++) {
if (!same_band(freq, entry[i].freq))
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册