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: 100301 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp1405802obb; Mon, 22 May 2017 06:51:11 -0700 (PDT) X-Received: by 10.98.14.131 with SMTP id 3mr25879761pfo.23.1495461071259; Mon, 22 May 2017 06:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495461071; cv=none; d=google.com; s=arc-20160816; b=tgMdiqjQa1qRZpFmF+HqDnvJXwcfdFBLeyY2rm58NImbu6baFci9t/V+DFoYh/3LwX lFqtvXhsOoqZrjnuXV7miKX3vFF8LXVbS5Bn7Z/Rh8urwfPYKmCDdGal74mGcp6dH/cl kgLb7boy+Meof0HxHntIFrVAFKNJ7D8NHjl9NJmC6ZbDGtMsRfNBpftXzQ5KdGECCirX GnH0Cdr6jKOgmwc90rD13hj9iL0NOGVA5zW5S4kwhwHvQkdwomU8fw8xUV9Mh+UMgAuA BoLy+ZkhrFML7uQnIg+o8IRxFLY9qqCz8yiCtiV1FCd7gjEX5SiMvM4CcDPF2WSnEvKp IVbA== 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=1XZki8WQl++e8qqfZ5kHKbigZVRwQPI2HweMmABoQIU=; b=cLZWQe91bs4FQ2Z4wd++J+Oes70XTfX8WNmjujVD4C+Sht2W7hOIEwwMuhWyg6qflC F0I48AEtS7oOzO3HtjpYoLWMK5MsHHu2jbSzEzazSD1oqUXKSwzzXyjkZKggCNjoYYWy /otNpKd0F/KNJVqLcV1axck5/wm3ojzuog2zXbv2Nz58C/GyNxnWblhkbGuDAR5LZSoh DALU+1v77jfF1nxKjfKjAGWYLoUJ2K3stH0Md879IZ9Q1QNSJaXGUI+awCjP6fTTb8NF 5jLAa9F/yelf+0B2sUHkkH9tKwdO6Muc6fxqhxUFzmX9dACEZIXtbG/0fOd5+JAzTdft WbfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 32si17048461plg.323.2017.05.22.06.51.10; Mon, 22 May 2017 06:51:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933597AbdEVNvD (ORCPT + 25 others); Mon, 22 May 2017 09:51:03 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:34213 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755189AbdEVNvA (ORCPT ); Mon, 22 May 2017 09:51:00 -0400 Received: by mail-pf0-f179.google.com with SMTP id 9so83127679pfj.1 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=eLvtjBY493ANQksgyTWmxMxP0uQ5u0PC70DMGHRnaoVGiu5Av05B4kyYSfCMV2HTCF 0qWDo676/benuMQE4wAjSwTaFpzia1ooful1pj4IQ1VqMO6jgWw552B1zw83tRW1nZ3s BoY1mdH/i3QYh5OWiEPgGtWNcfz3rYazA6IGirdBK9MDTFZWKPjeIS8QUi6psP//fuVp fggBV76nbJzR3+Jx9KdiMzAosmGt6VAha6QoNbNiXIh8/xVizujA0CriLrXcPoMOkMBO BHKOM4LjLhthSiXz5ocW6/TqSffJat0KoaQ3y0AuQBiLquwcNIkZ60i9jJYsD4nStG9Z jy0Q== X-Gm-Message-State: AODbwcBNi50TvZfaRjgrYErP+2rUL4r8L77w/pB7Fk4oqQU/1O6stRFf +nXNjJKxYi/MWwYP 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 Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Guodong Xu 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/bluetooth/hci_ll.c | 1 + 1 file changed, 1 insertion(+) -- 2.10.2 Acked-by: Rob Herring 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);