Skip to content

Commit beb9cca

Browse files
XenoamorJoshua Booth
authored andcommitted
Fix null pointer dereference in ad9361_rfpll_vco_init
Signed-off-by: Joshua Booth <[email protected]>
1 parent ae557a3 commit beb9cca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/rf-transceiver/ad9361/ad9361.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ static int32_t ad9361_rfpll_vco_init(struct ad9361_rf_phy *phy,
17461746
uint32_t ref_clk)
17471747
{
17481748
struct no_os_spi_desc *spi = phy->spi;
1749-
const struct SynthLUT(*tab);
1749+
const struct SynthLUT(*tab) = NULL;
17501750
int32_t i = 0;
17511751
uint32_t range, offs = 0;
17521752

@@ -1775,6 +1775,12 @@ static int32_t ad9361_rfpll_vco_init(struct ad9361_rf_phy *phy,
17751775
}
17761776
}
17771777

1778+
if (tab == NULL) {
1779+
dev_err(&phy->spi->dev,
1780+
"%s: Failed to find suitable SynthLUT table", __func__);
1781+
return -EINVAL;
1782+
}
1783+
17781784
if (tx)
17791785
offs = REG_TX_VCO_OUTPUT - REG_RX_VCO_OUTPUT;
17801786

0 commit comments

Comments
 (0)