qcacmn: Initialized pdev id with default value 0xFF

pdev_id is being initialized with 0. Since 0 is valid pdev_id, though
pdev is not present for that id, it is being accessed.

Initialized pdev_id to 0xFF by default. Added checks on API to
detect valid pdev_id value corresponding to lmac_id

Change-Id: I2b2a38783615494ccc08e265702815f7e562214b
Šī revīzija ir iekļauta:
Pavankumar Nandeshwar
2020-02-26 18:24:52 +05:30
revīziju iesūtīja nshrivas
vecāks 2eb8560c88
revīzija 9b0c1271ed
10 mainīti faili ar 102 papildinājumiem un 14 dzēšanām

Parādīt failu

@@ -1377,13 +1377,11 @@ dp_get_lmac_id_for_pdev_id
static inline struct dp_pdev *
dp_get_pdev_for_lmac_id(struct dp_soc *soc, uint32_t lmac_id)
{
int i = 0;
uint8_t i = 0;
if (wlan_cfg_per_pdev_lmac_ring(soc->wlan_cfg_ctx)) {
i = wlan_cfg_get_pdev_idx(soc->wlan_cfg_ctx, lmac_id);
qdf_assert_always(i < MAX_PDEV_CNT);
return soc->pdev_list[i];
return ((i < MAX_PDEV_CNT) ? soc->pdev_list[i] : NULL);
}
/* Typically for MCL as there only 1 PDEV*/
@@ -1449,7 +1447,7 @@ dp_get_host_pdev_id_for_target_pdev_id
/*Get host pdev from lmac*/
pdev = dp_get_pdev_for_lmac_id(soc, lmac_id);
return pdev->pdev_id;
return pdev ? pdev->pdev_id : INVALID_PDEV_ID;
}
/*