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

Commit ed2b05c8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "radio: iris: Avoid NULL pointer dereferencing"

parents 3f52b495 30a754fa
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -154,7 +154,13 @@ static int radio_hci_smd_register_dev(struct radio_data *hsmd)
	struct radio_hci_dev *hdev;
	int rc;

	if (hsmd == NULL)
		return -ENODEV;

	hdev = kmalloc(sizeof(struct radio_hci_dev), GFP_KERNEL);
	if (hdev == NULL)
		return -ENODEV;

	hsmd->hdev = hdev;
	tasklet_init(&hsmd->rx_task, radio_hci_smd_recv_event,
		(unsigned long) hsmd);
@@ -167,6 +173,8 @@ static int radio_hci_smd_register_dev(struct radio_data *hsmd)

	if (rc < 0) {
		FMDERR("Cannot open the command channel");
		hsmd->hdev = NULL;
		kfree(hdev);
		return -ENODEV;
	}

@@ -174,6 +182,9 @@ static int radio_hci_smd_register_dev(struct radio_data *hsmd)

	if (radio_hci_register_dev(hdev) < 0) {
		FMDERR("Can't register HCI device");
		smd_close(hsmd->fm_channel);
		hsmd->hdev = NULL;
		kfree(hdev);
		return -ENODEV;
	}