Skip to content

Commit 4579954

Browse files
Yuuoniygregkh
authored andcommitted
Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe
[ Upstream commit 6845667 ] The function devm_gpiod_get_index() return error pointers on error. Thus devm_gpiod_get_index_optional() could return NULL and error pointers. The same as devm_gpiod_get_optional() function. Using IS_ERR_OR_NULL() check to catch error pointers. Fixes: 77131df ("Bluetooth: hci_qca: Replace devm_gpiod_get() with devm_gpiod_get_optional()") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f6bf3d6 commit 4579954

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/bluetooth/hci_qca.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
19901990

19911991
qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable",
19921992
GPIOD_OUT_LOW);
1993-
if (!qcadev->bt_en) {
1993+
if (IS_ERR_OR_NULL(qcadev->bt_en)) {
19941994
dev_warn(&serdev->dev, "failed to acquire enable gpio\n");
19951995
power_ctrl_enabled = false;
19961996
}

0 commit comments

Comments
 (0)