From patchwork Mon Aug 13 09:32:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10563949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D22C313B4 for ; Mon, 13 Aug 2018 09:33:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFFC328492 for ; Mon, 13 Aug 2018 09:33:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1F5D284AA; Mon, 13 Aug 2018 09:33:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67E8F28492 for ; Mon, 13 Aug 2018 09:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=GD76jYoNWPPCoctghBSji8d9a/TkV2nUSNUhSuxpgww=; b=XC9foBjqtFFlfw wtz2sPZRwEpyNUaXPycGhNYaOD4IA6L3e5PYH9XnyA1bXjy80a7xna+dQqEactv+gthMCVoPDFlG/ 7XffJi4JD94goTMV5t5Neraaq4XYaXnMVTzj8CC5nC8/INYuUCWWgA52wI14FN4kACFvZpwo6Ah/p aLmx4KeYaMCnb1R387B/3hciH/TETuhuLHE0qQbWAr8SNZ7YHd1NZkWzx2ng9VjuIZ2DbFOar3y5q BQ1qQa5+/Fhjen16Ln3ULIDUbiy0Ms8d3nzQ4YFJaTPetNUZXPFIPfRjIJ8SLmwQfEYJCQk1cBkJX 2ZD4IzicRARr9ptNSByw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fp9Dn-0005me-Qx for patchwork-linux-mediatek@patchwork.kernel.org; Mon, 13 Aug 2018 09:33:07 +0000 Received: from aserp2130.oracle.com ([141.146.126.79]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fp9Dk-0005le-K3 for linux-mediatek@lists.infradead.org; Mon, 13 Aug 2018 09:33:06 +0000 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7D9Omkt181548; Mon, 13 Aug 2018 09:32:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=S2Ox51j1fXQaUjmr1Dmffq7tksQll6LhpJcHCpePupw=; b=dKEEyvcZMuZMFBdowId0LkuRKPq7zy4hmKPLPqn9YZTWACXUrqMzBubFDFNK3ul3BE5j 8fHDRCes11um5TtcYPq3dlkNg/3ob5ElEKa/OdKMeWzUYf1pnJunznw+JeXcxGa+jjSJ W6MfksxBLmjMS94PlL4fsFAzaO8qF+6skbH8outrq2Qo4jIwUZu7fgrR3jkuXXgRNK82 KF96l36xBmQukjVUsKHnx/pfYec3TuKnqKKCixu203aQQFa6Bd7Ew0etUvPEv1Dp7JNH a0srcJSpuxa/CZIV6fSZXyVPPUqX21JtYlXOvTvlvVmWe4jcdBSY5J2SScGovn38TdnP uQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2ksnacujja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Aug 2018 09:32:47 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7D9WkYQ026226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Aug 2018 09:32:47 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w7D9Wh7N003171; Mon, 13 Aug 2018 09:32:44 GMT Received: from kili.mountain (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Aug 2018 02:32:42 -0700 Date: Mon, 13 Aug 2018 12:32:35 +0300 From: Dan Carpenter To: Sean Wang Subject: [PATCH] Bluetooth: mediatek: pass correct size to h4_recv_buf() Message-ID: <20180813093235.hksi2c2ev37j4gji@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8983 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=818 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808130104 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180813_023304_743813_4272C909 X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johan Hedberg , Marcel Holtmann , kernel-janitors@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We're supposed to pass the number of elements in the mtk_recv_pkts, not the number of bytes. Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices") Signed-off-by: Dan Carpenter diff --git a/drivers/bluetooth/btmtkuart.c b/drivers/bluetooth/btmtkuart.c index e0571fe04d00..ed2a5c7cb77f 100644 --- a/drivers/bluetooth/btmtkuart.c +++ b/drivers/bluetooth/btmtkuart.c @@ -346,7 +346,7 @@ static int btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count) bdev->rx_skb = h4_recv_buf(bdev->hdev, bdev->rx_skb, p_h4, sz_h4, mtk_recv_pkts, - sizeof(mtk_recv_pkts)); + ARRAY_SIZE(mtk_recv_pkts)); if (IS_ERR(bdev->rx_skb)) { err = PTR_ERR(bdev->rx_skb); bt_dev_err(bdev->hdev,