Bluetooth: Introduce Qualcomm WCNSS SMD based HCI driver
Hello Bjorn Andersson,
The patch 1511cc750c3d: "Bluetooth: Introduce Qualcomm WCNSS SMD based HCI driver" from Aug 12, 2016, leads to the following static checker warning:
drivers/bluetooth/btqcomsmd.c:164 btqcomsmd_probe() warn: 'btq->acl_channel' isn't an ERR_PTR
drivers/bluetooth/btqcomsmd.c
149 static int btqcomsmd_probe(struct platform_device *pdev) 150 {
151 struct btqcomsmd *btq; 152 struct hci_dev *hdev; 153 void *wcnss; 154 int ret;
155
156 btq = devm_kzalloc(&pdev->dev, sizeof(*btq), GFP_KERNEL);
157 if (!btq)
158 return -ENOMEM;
159
160 wcnss = dev_get_drvdata(pdev->dev.parent);
161
162 btq->acl_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_ACL",
163 btqcomsmd_acl_callback, btq);
164 if (IS_ERR(btq->acl_channel))
165 return PTR_ERR(btq->acl_channel);
The qcom_wcnss_open_channel() returns error pointers if the CONFIG is disabled, otherwise it returns NULL on error. That seems like a design mistake to me... Anyway, it leads to a bug here.
166
167 btq->cmd_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_CMD",
168 btqcomsmd_cmd_callback, btq);
169 if (IS_ERR(btq->cmd_channel))
170 return PTR_ERR(btq->cmd_channel);
171
172 /* The local-bd-address property is usually injected by the
regards,
dan carpenter