Skip to content

Commit

Permalink
carl9170: devres ar->survey_info
Browse files Browse the repository at this point in the history
driver keeps the same survey_info struct for its lifetime around.
This is used because while firmware does help by providing accounting
information of the current channel, it doesn't keep track on the
remaining channels.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/9b9a059b384f49587f4384ba47f01d3fb2115b22.1646250537.git.chunkeey@gmail.com
  • Loading branch information
Christian Lamparter authored and Kalle Valo committed Mar 10, 2022
1 parent a8da65f commit 83fe43a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/wireless/ath/carl9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,8 @@ static int carl9170_parse_eeprom(struct ar9170 *ar)
if (!bands)
return -EINVAL;

ar->survey = kcalloc(chans, sizeof(struct survey_info), GFP_KERNEL);
ar->survey = devm_kcalloc(&ar->udev->dev, chans,
sizeof(struct survey_info), GFP_KERNEL);
if (!ar->survey)
return -ENOMEM;
ar->num_channels = chans;
Expand Down Expand Up @@ -2046,9 +2047,6 @@ void carl9170_free(struct ar9170 *ar)
kfree_skb(ar->rx_failover);
ar->rx_failover = NULL;

kfree(ar->survey);
ar->survey = NULL;

mutex_destroy(&ar->mutex);

ieee80211_free_hw(ar->hw);
Expand Down

0 comments on commit 83fe43a

Please sign in to comment.