Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932226AbcLAGYX (ORCPT ); Thu, 1 Dec 2016 01:24:23 -0500 Received: from m12-18.163.com ([220.181.12.18]:41596 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753431AbcLAGYW (ORCPT ); Thu, 1 Dec 2016 01:24:22 -0500 From: Pan Bian To: Marcel Holtmann , Gustavo Padovan , Johan Hedberg Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH 1/1] bluetooth: propagate the error code Date: Thu, 1 Dec 2016 14:23:29 +0800 Message-Id: <1480573409-18520-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: EsCowACHxOXjwT9YieZOEg--.49583S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrKFW8Wr4ftFyfGF4DKFWUtwb_yoWfKFg_W3 4Iyws3Gwn5AF1xG3WjkaySv343try3W3WkZwnaqasxZr98ur9rAFs0vr95Jr4fWr1fKF9r CFn0qrWrAr1UtjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUYLAw3UUUUU== X-Originating-IP: [106.120.213.17] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/1tbiVAkzclUL+lS+aAAAs6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 924 Lines: 28 Fix bug https://bugzilla.kernel.org/show_bug.cgi?id=188551. A negative return value means there are errors, while 0 indicates success. However, in function bpa10x_send_frame(), it returns 0 no matter whether usb_submit_urb() returns a negative value. As a result, the caller of bpa10x_send_frame() may not detect the submission error. In this patch, use "return err;" at the end to propagate the error. Signed-off-by: Pan Bian --- drivers/bluetooth/bpa10x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index a9932fe..d2bebee 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c @@ -355,7 +355,7 @@ static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) usb_free_urb(urb); - return 0; + return err; } static int bpa10x_set_diag(struct hci_dev *hdev, bool enable) -- 1.9.1