Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 202b0720 authored by Smriti Gupta's avatar Smriti Gupta Committed by Rupesh Tatiya
Browse files

radio: initialize spacing to default value.



Initialize spacing to default value 0 to avoid undefined behaviour in some
code branches.

Change-Id: I072e507b005236a4d08fa192135b37e32780d59c
CRs-fixed: 1070487
Signed-off-by: default avatarSmriti Gupta <smritig@codeaurora.org>
Signed-off-by: default avatarRupesh Tatiya <rtatiya@codeaurora.org>
parent 1873f86a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -628,11 +628,15 @@ int radio_hci_unregister_dev(void)
	struct iris_device *radio = video_get_drvdata(video_get_dev());
	struct radio_hci_dev *hdev = NULL;

	if (!radio && !radio->fm_hdev) {
		FMDERR("radio/hdev is null");
	if (!radio) {
		FMDERR("radio is null");
		return -EINVAL;
	}
	hdev = radio->fm_hdev;
	if (!hdev) {
		FMDERR("hdev is null");
		return -EINVAL;
	}

	tasklet_kill(&hdev->rx_task);
	tasklet_kill(&hdev->cmd_task);
+3 −1
Original line number Diff line number Diff line
@@ -1357,7 +1357,7 @@ static bool is_valid_freq(struct silabs_fm_device *radio, u32 freq)
{
	u32 band_low_limit = radio->recv_conf.band_low_limit * TUNE_STEP_SIZE;
	u32 band_high_limit = radio->recv_conf.band_high_limit * TUNE_STEP_SIZE;
	u8 spacing;
	u8 spacing = 0;

	if (radio->recv_conf.ch_spacing == 0)
		spacing = CH_SPACING_200;
@@ -1365,6 +1365,8 @@ static bool is_valid_freq(struct silabs_fm_device *radio, u32 freq)
		spacing = CH_SPACING_100;
	else if (radio->recv_conf.ch_spacing == 2)
		spacing = CH_SPACING_50;
	else
		return false;

	if ((freq >= band_low_limit) &&
		(freq <= band_high_limit) &&