]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: hci_bcm: Fix empty regulator supplies for Intel Macs
authorChen-Yu Tsai <wens@csie.org>
Mon, 1 Apr 2019 03:43:12 +0000 (11:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 May 2019 05:49:55 +0000 (07:49 +0200)
commitd00686df16844a12910fae00dbc79b228e50cce7
treef34c3b9efcb354994094579e2407c2866e14e11a
parenta324fa50549a0a30676cd4e0aa7d1d0c11a503a1
Bluetooth: hci_bcm: Fix empty regulator supplies for Intel Macs

commit 62611abc8f37d00e3b0cff0eb2d72fa92b05fd27 upstream.

The code path for Macs goes through bcm_apple_get_resources(), which
skips over the code that sets up the regulator supplies. As a result,
the call to regulator_bulk_enable() / regulator_bulk_disable() results
in a NULL pointer dereference.

This was reported on the kernel.org Bugzilla, bug 202963.

Unbreak Broadcom Bluetooth support on Intel Macs by checking if the
supplies were set up before enabling or disabling them.

The same does not need to be done for the clocks, as the common clock
framework API checks for NULL pointers.

Fixes: 75d11676dccb ("Bluetooth: hci_bcm: Add support for regulator supplies")
Cc: <stable@vger.kernel.org> # 5.0.x
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Imre Kaloz <kaloz@openwrt.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bluetooth/hci_bcm.c