From patchwork Mon May 22 13:50:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 9740369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B27F6034C for ; Mon, 22 May 2017 13:51:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08C1828285 for ; Mon, 22 May 2017 13:51:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F18E52842B; Mon, 22 May 2017 13:51:26 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 8ABC128285 for ; Mon, 22 May 2017 13:51:26 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From: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=ZkWt0gBK66/E0jKqsq6byYAMehU7j0B2+vp+ix+Rv6U=; b=edz szUt0zkRLGC9wIYC96bWtIZMet0yZ5vtJYE3Pe8v4H8OLoiV2qqDIWQaahzXC77McSLuQSKaqMsan qyknkY6BTeIZLgTuZPJwqZ4xClm6kX8M6/dK9oxI/KYObKDC+j4qVrS2l6abEmChMIu6BnnY9KAwQ brAVS51WEINhOgfzu7QJ9rMle7E9narw326WrEzsj8t19PKP1Hziu2PFREMIlo7hbVpbELMDdnAWq m4eidePk+QkcZwS7S6SbIAOokXXUTVfZud6MmXj+k3Fm4sPef3dibDlWDEcgjKGuOM0wwJqno1RmU n7q1vK3KF0Q5uwevXL4UTQImvBQrTFQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dCnk5-00070B-Be; Mon, 22 May 2017 13:51:25 +0000 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dCnk1-0006z6-3S for linux-arm-kernel@lists.infradead.org; Mon, 22 May 2017 13:51:23 +0000 Received: by mail-pf0-x230.google.com with SMTP id n23so83086187pfb.2 for ; Mon, 22 May 2017 06:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=1XZki8WQl++e8qqfZ5kHKbigZVRwQPI2HweMmABoQIU=; b=PA/yWt1EVXIcSYEu2SZFtKZxYFrz7oqMCaQJ1ZU+EzwY4373hoX8/8WYc66xNkeKmx T1Qel/MhPWrfd3AR1tmuusfcr05xUF11TLSxzn5sgyA6gquY9hqQ8r1ShmPzAEUWr76i aUh06jRXvbBW7D+lxT648hgyk7FATr8mXXvko= 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=1XZki8WQl++e8qqfZ5kHKbigZVRwQPI2HweMmABoQIU=; b=QxgFjd3oL+pZij9+30X92xXmz02wLROmd5q4YE7U7wuPLOKG0xS5fZq3JgKg5NpKRo 9lObG2CW1CeFMVy03xxknt+aLvsmzIwnbIsqnJlBJrwFIPpcQf2bqGtktJ++aJ7SsfBx vpJo0Pg78U9LdqCESs4A6FL7rAkCteP5ozj8oAXK1r7pVvuYufE766ckmPp/f9nVXGc9 Xr78JUVYpxvAl+YbPTrQlkZCmxOs4U9csJ6Y7wY4eXRiXc8K//KiCLIKCpIedDaTEhQZ qjxQqqBFM5r4EUI3yV4LRAWlAMrcPGHhcR11ZYU8lBKv/wiSW5l5AXAyYPp6Izoffe+N drrg== X-Gm-Message-State: AODbwcAD5VZkmAuRUbaCcH19aJzJh1ZJOLCtVuh8uaZtXaRz4R6XUf/w 6mCDIm9w2tcQSGZq X-Received: by 10.84.214.23 with SMTP id h23mr29878443pli.127.1495461060044; Mon, 22 May 2017 06:51:00 -0700 (PDT) Received: from docularxu-ThinkPad-T440p.219.146.1.66 ([45.56.159.159]) by smtp.gmail.com with ESMTPSA id h7sm33325548pfc.97.2017.05.22.06.50.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 May 2017 06:50:59 -0700 (PDT) From: Guodong Xu To: marcel@holtmann.org, gustavo@padovan.org, johan.hedberg@gmail.com, robh@kernel.org Subject: [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails Date: Mon, 22 May 2017 21:50:42 +0800 Message-Id: <20170522135042.10921-1-guodong.xu@linaro.org> X-Mailer: git-send-email 2.10.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170522_065121_169885_B08A50E1 X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-bluetooth@vger.kernel.org, Guodong Xu , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When __hci_cmd_sync() fails, download_firmware() should also fail, and the same error value should be returned as PTR_ERR(skb). Without this fix, download_firmware() will return a success when it actually failed in __hci_cmd_sync(). Fixes: 371805522f87 ("bluetooth: hci_uart: add LL protocol serdev driver support") Signed-off-by: Guodong Xu Acked-by: Rob Herring --- drivers/bluetooth/hci_ll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c index adc444f..200288c 100644 --- a/drivers/bluetooth/hci_ll.c +++ b/drivers/bluetooth/hci_ll.c @@ -624,6 +624,7 @@ static int download_firmware(struct ll_device *lldev) skb = __hci_cmd_sync(lldev->hu.hdev, cmd->opcode, cmd->plen, &cmd->speed, HCI_INIT_TIMEOUT); if (IS_ERR(skb)) { bt_dev_err(lldev->hu.hdev, "send command failed\n"); + err = PTR_ERR(skb); goto out_rel_fw; } kfree_skb(skb);