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

Commit 37134167 authored by Chan-yeol Park's avatar Chan-yeol Park Committed by Marcel Holtmann
Browse files

Bluetooth: hci_uart: Fix dereferencing of ERR_PTR



If h4_recv_buf() return ERR_PTR instead sk_buff pointer, it should be
cleared once PTR_ERR is completed for the further dereference such as
h4_recv(), or h4_close().

Signed-off-by: default avatarChan-yeol Park <chanyeol.park@samsung.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 30811fa6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ static int ath_recv(struct hci_uart *hu, const void *data, int count)
	if (IS_ERR(ath->rx_skb)) {
		int err = PTR_ERR(ath->rx_skb);
		BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err);
		ath->rx_skb = NULL;
		return err;
	}

+1 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ static int bcm_recv(struct hci_uart *hu, const void *data, int count)
	if (IS_ERR(bcm->rx_skb)) {
		int err = PTR_ERR(bcm->rx_skb);
		BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err);
		bcm->rx_skb = NULL;
		return err;
	}

+1 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ static int h4_recv(struct hci_uart *hu, const void *data, int count)
	if (IS_ERR(h4->rx_skb)) {
		int err = PTR_ERR(h4->rx_skb);
		BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err);
		h4->rx_skb = NULL;
		return err;
	}