From patchwork Wed Feb 28 00:17:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 129878 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp413263lja; Tue, 27 Feb 2018 16:17:47 -0800 (PST) X-Google-Smtp-Source: AH8x227Y2Ea1b9NkzjkvVqjHQPcEMGMLZqODn30q+jni0SLGJtRGkWKgsLTq4h/HRe/Yd7wGAnkv X-Received: by 10.99.103.69 with SMTP id b66mr12597485pgc.233.1519777067790; Tue, 27 Feb 2018 16:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519777067; cv=none; d=google.com; s=arc-20160816; b=Vgw3QQPeL58OJCAy7MHIWTiEqA5v3yOf9ELUJLpr8PblKumF9BYtnXBvtv4P1ZS7L1 RrkDKIzXeYYdgskNQo8YSJ4Np2NF+c8TEH1xZCdDSZhfihS/Oev/Tjj6Np6Jtnu+Vm68 Yi6QB8+XhXYfyJBD6KGr16Z113HO//p7A50cRykHL0gepPaXmkpihsDr1UGP88pc+TR6 /+xq08pHkH1RUpMQKWuuGwR9hqCfaaKRnAREvR7IeTge6O5QYG2XarOICWytZ7WJG9r6 BwcYvccKc30ELzA8tAI51xmpDi40b257waGOUc7vq8J+SDwjO/1fUa2Ry6iMtj60PH6z 9eQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=P5cf8h1qr+Ek8fbxwz1FAX8axqrVEzp6QzZWGuKq9UM=; b=DLQ8k3qG25lpQ2kwaYH7fKk/+BCv/TGgIF7uR1UOO4HQx9QHUDNqffpmcpiKafrz2B FG0bI/OyHqMZXzvGR+fDLW1EwEe1T4GlcsuebwR/QDnXnqwnNn726MOHr4R8koKKYvpQ 0qBYeVwl9pMKCDSY9mXxPlEYPOsEEk5TS47fM5GHBlwFra3bJ2FQX2SmjyTk93NSikhL Oo6f3YpD0EXLmLt2INibljGJsq3GBPp45hhMbUW8w1skzbnfyehOecAc6Ngo54JUEdjv ZrWdBRhvQSf2VUBiGscnXz706qXc3JiMFrmbGs//vDrhfSqNNjcJMzNuww0uSK2jAXVc di6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=goyDT/Iw; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i124si215510pgc.589.2018.02.27.16.17.47; Tue, 27 Feb 2018 16:17:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=goyDT/Iw; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751968AbeB1ARo (ORCPT + 1 other); Tue, 27 Feb 2018 19:17:44 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:37717 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752055AbeB1ARm (ORCPT ); Tue, 27 Feb 2018 19:17:42 -0500 Received: by mail-pl0-f67.google.com with SMTP id ay8-v6so425569plb.4 for ; Tue, 27 Feb 2018 16:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=U/QkfmC2c4JdWu1eX+drVfbbyfLPRt4bxC/tLhKPUi0=; b=goyDT/Iwlcj8qkxBztzvDL87zb1h1oFc2pz+QjYlO/CgwdfXKVOByGiZstmmiH5WDc Rmfr4t+Xliu8AfEkwO0pCDWrnuBBXX258ysyibv/t6987XGeUvHAHb8dpWlxYNGppEtC GDdXwa+5H6gE9X2ZiCxNuM6yfqDQv2dmF4TlI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=U/QkfmC2c4JdWu1eX+drVfbbyfLPRt4bxC/tLhKPUi0=; b=YU7kbBwavdxr0ArNy+I0KFsspLkUtOVqOSIO4ro438CMNgj7LB+YvBnnX6lJfLVdrE NAX5602dyy9gBXTvzNP2V8k6VsXQ+n82Jg6/AY1eGyk1NbYrqPvg7AX+RdKw4lpgnjPa Z0FdfWNq+QTmYRCYP5eFlcowRsTRO9r6Ufn97KFvVXeXqPzId/EKuM52+c9+0A1YX0NW 63F4pxWdPSM6iGPfONAphyD7lsAo95ew4r9RzNC3piGA8Z5xy14A3OwX5xHJgf+nbEDB YmHVEWghYrdUaBSd8x+6U4OoSslLXrsgYLH6j8Tp6t7bBQM44gDhBftn4eYMXUoSvuxG Hy2w== X-Gm-Message-State: APf1xPAp2cnibdJTmu2M5TqdmCCSi8vmAijZW5iFcknNkJifFiXWvig8 3dEv5PNu1zod+25MtYy8iRB/aw== X-Received: by 2002:a17:902:8646:: with SMTP id y6-v6mr16300357plt.406.1519777061898; Tue, 27 Feb 2018 16:17:41 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id d4sm304315pgv.24.2018.02.27.16.17.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 16:17:41 -0800 (PST) From: Bjorn Andersson To: Marcel Holtmann , Johan Hedberg , Andy Gross , David Brown Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] Bluetooth: btqcomsmd: Fix channel open check Date: Tue, 27 Feb 2018 16:17:38 -0800 Message-Id: <20180228001738.11131-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.16.2 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org rpmsg_create_ept() returns NULL on error and as such qcom_wcnss_open_channel() does the same. Clarify this in the kernel-doc and correct the error checks in btqcomsmd. Fixes: 1511cc750c3d ("Bluetooth: Introduce Qualcomm WCNSS SMD based HCI driver") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson --- drivers/bluetooth/btqcomsmd.c | 8 ++++---- drivers/soc/qcom/wcnss_ctrl.c | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.16.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c index 2c9a5fc9137d..24f702927875 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -151,13 +151,13 @@ static int btqcomsmd_probe(struct platform_device *pdev) btq->acl_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_ACL", btqcomsmd_acl_callback, btq); - if (IS_ERR(btq->acl_channel)) - return PTR_ERR(btq->acl_channel); + if (!btq->acl_channel) + return -ENOENT; btq->cmd_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_CMD", btqcomsmd_cmd_callback, btq); - if (IS_ERR(btq->cmd_channel)) - return PTR_ERR(btq->cmd_channel); + if (!btq->cmd_channel) + return -ENOENT; /* The local-bd-address property is usually injected by the * bootloader which has access to the allocated BD address. diff --git a/drivers/soc/qcom/wcnss_ctrl.c b/drivers/soc/qcom/wcnss_ctrl.c index d008e5b82db4..e968559b0fc4 100644 --- a/drivers/soc/qcom/wcnss_ctrl.c +++ b/drivers/soc/qcom/wcnss_ctrl.c @@ -275,6 +275,8 @@ static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc) * @wcnss: wcnss handle, retrieved from drvdata * @name: SMD channel name * @cb: callback to handle incoming data on the channel + * + * Return: rpmsg_endpoint object on success, NULL on error */ struct rpmsg_endpoint *qcom_wcnss_open_channel(void *wcnss, const char *name, rpmsg_rx_cb_t cb, void *priv) {