2021-07-13 09:58:20

by Dan Carpenter

[permalink] [raw]
Subject: [bug report] soc: qcom: smd: Transition client drivers from smd to rpmsg

Hello Bjorn Andersson,

The patch 5052de8deff5: "soc: qcom: smd: Transition client drivers
from smd to rpmsg" from Mar 27, 2017, leads to the following static
checker warning:

drivers/bluetooth/btqcomsmd.c:140 btqcomsmd_probe()
warn: 'btq->acl_channel' is not an error pointer

drivers/bluetooth/btqcomsmd.c
125 static int btqcomsmd_probe(struct platform_device *pdev)
126 {
127 struct btqcomsmd *btq;
128 struct hci_dev *hdev;
129 void *wcnss;
130 int ret;
131
132 btq = devm_kzalloc(&pdev->dev, sizeof(*btq), GFP_KERNEL);
133 if (!btq)
134 return -ENOMEM;
135
136 wcnss = dev_get_drvdata(pdev->dev.parent);
137
138 btq->acl_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_ACL",
139 btqcomsmd_acl_callback, btq);
140 if (IS_ERR(btq->acl_channel))

The qcom_wcnss_open_channel() original returned error pointers on error
but now it returns NULL on error and error pointers if it is disabled in
the .config file.

141 return PTR_ERR(btq->acl_channel);
142
143 btq->cmd_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_CMD",
144 btqcomsmd_cmd_callback, btq);
145 if (IS_ERR(btq->cmd_channel)) {
146 ret = PTR_ERR(btq->cmd_channel);
147 goto destroy_acl_channel;
148 }
149

regards,
dan carpenter