Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4680507ima; Mon, 4 Feb 2019 22:43:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IbIvrpgNTaPucOFpIgra7wsdoOqzauzUVmGD7w3wxkruHxZukMQ7K9mWsc24oe7xF+/UdVp X-Received: by 2002:a63:1321:: with SMTP id i33mr3205661pgl.380.1549349019890; Mon, 04 Feb 2019 22:43:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549349019; cv=none; d=google.com; s=arc-20160816; b=vC86CF4oodgKvq0bD4BcWkE4hmi5dakZ5d1Ki97vcoUiZxSyN8lL/rqUbBlrJU3zUZ D/Yt/O2iF0onJkQ88tOUQsHJCaDsMTp6dT+MIntYkCUYzGurzmzfIG0MX4NDlpLiokR6 JNaE0adzO9o6AuMElRZZl9cI7jWFzaUyGkoQQx8zxu1h3UrQu2KeSQDAXJi1tWJ4rkn8 iqXT84S6h1s29I3Kk1JbBxbhq81/BHn88kDJYOqcp0EmkAM2L8vpwErfvUivOdpKf8yB 8KlOHcdJGQBpoxS1x5X1Re6VttlBNgxbznLLh346YrlgurSIgCFyBkj8NEcrpXZ0forh uuvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=UKKQw3AIruBvt5w48fVg81+3xC1ANTdWQ+Z3IPEfCJk=; b=0AH02XJHCIvwJsVHcsf+j0DAStWT1Xvoujck88Y2nkx5fmDZ67LyBLMsD4dqXaCVrE MagO/8yAoX+u6fMEbHavfGfxpSy9yCkJsn3FXVAzSTsgzyq/XUvrtHiIxB3L/mbIKQSh 04Y5NLxS8tOdXJPCy2fCJO/f4ie+gIMrysHGdxrByGkcM3WWO+afxJT0tkmb/wwAwf7n b/JDMludWrvKcZhM6gtxmwMxHh09i/buUObQXBv1At6cNnroVIZ/eci75NpyI5jAeaGJ TDIIct52gnFl85crihozzk50Qnt8qfahIughCFkZNiBUF9vx/wdpyndnRdkYcvorP6AH U3iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dpKJej3p; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si2350331plt.111.2019.02.04.22.43.23; Mon, 04 Feb 2019 22:43:39 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=dpKJej3p; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727481AbfBEGnO (ORCPT + 99 others); Tue, 5 Feb 2019 01:43:14 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40429 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726416AbfBEGnN (ORCPT ); Tue, 5 Feb 2019 01:43:13 -0500 Received: by mail-pf1-f196.google.com with SMTP id i12so1070680pfo.7; Mon, 04 Feb 2019 22:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=UKKQw3AIruBvt5w48fVg81+3xC1ANTdWQ+Z3IPEfCJk=; b=dpKJej3pCHd7HistK/ZDgQpymxPvdETcAb0vdMeJtFfF6o74HyHbi4+wKiSgya6Xph 9ceh/APqALuj736NDM8Z3k+hACM3bWKdMYuy/ZDd6mKe7+Xz3OjasZvTT5DOZKqXxI2S jdV9FMercFC+GYxQFkyd/XQ3kxWGOroHnXdjxB26HDQGjLrTdoQx4Z2ttE69shrPUHT+ 1Dobh/dsSnfcrHTx69TtulYvjhuPxffYnX4Bjht+/53HBgvmAqnKuZH+mVIVejDiVa2h lWWS+L9d0f+/5z5+6VTK8z1FFk5sHXD3CyQvDrXnXqx4uaNy6Szd28hwqJVmQIRzjA32 GGBw== 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:in-reply-to :references:in-reply-to:references; bh=UKKQw3AIruBvt5w48fVg81+3xC1ANTdWQ+Z3IPEfCJk=; b=pKSjQAIGJ2r+LEQJeyPiBbT1VziHZkLb0XnIdS0kfIFOwr6kFm0aKfqN1na9vd3gri H/d5tuXkRQbp/sT5QhpYQK7u1RoPzeCJF6gdXDhpkzp0QPrR9AMuojlz4YWAOrDDysV8 o0LzVlb4dIc3xJYHHNZu3m6ogDpwW62KY51sKfZ1X+SwPxWw21Hfa783kbPNpM1E+nJn QFnis5rkYVshPDN3F31TFUMFvNHm5ZJbkHDkUetv2MKxBOe0oPJke+VrF7+5rn2w0K/M 6oiK2L5lnhdlo8Z6akqm0X4d8j9N5pBC3VK+8AWtX7Gab5HxbtSeK0MvmP2g6r6Bw0v+ gyLA== X-Gm-Message-State: AHQUAuaR1fzYwpPioR5t0d3iEXqvAQnbSW4bCO1eWT+Ec6nDT1/hUA33 Adtsic4b7rwOB4qAHZ8Sm6Q= X-Received: by 2002:a63:5463:: with SMTP id e35mr3137501pgm.260.1549348992653; Mon, 04 Feb 2019 22:43:12 -0800 (PST) Received: from localhost.localdomain (cpe-76-176-3-80.san.res.rr.com. [76.176.3.80]) by smtp.googlemail.com with ESMTPSA id k24sm2823687pfj.13.2019.02.04.22.43.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 22:43:12 -0800 (PST) From: Myungho Jung To: marcel@holtmann.org Cc: johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Myungho Jung , stable@vger.kernel.org Subject: [PATCH v3 1/2] Bluetooth: hci_ath: Add NULL check for tiocmget() and tiocmset() in ath_setup() Date: Mon, 4 Feb 2019 22:41:41 -0800 Message-Id: <7783b5bb10aa8d6adbbbad31e0030ac3e788c0a8.1549346039.git.mhjungk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tiocmget() and tiocmset() operations are optional so they are not guaranteed to be set. Return ENODEV in ath_setup() if tty driver doesn't support the operations. Fixes: 4c876c0edbdc ("hci_uart: Add Atheros support for address config") Cc: # 4.1 Signed-off-by: Myungho Jung --- Changes in v2: - Add NULL check and return error in ath_setup() instead of ath_hci_uart_work() Changes in v3: - Fix to return -ENODEV - Split into 2 patches - Add stable CC and fixes tags drivers/bluetooth/hci_ath.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c index d568fbd94d6c..9f1ac1805d23 100644 --- a/drivers/bluetooth/hci_ath.c +++ b/drivers/bluetooth/hci_ath.c @@ -185,8 +185,14 @@ static int ath_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) static int ath_setup(struct hci_uart *hu) { + struct tty_struct *tty = hu->tty; + BT_DBG("hu %p", hu); + /* tty driver should support operations to set RTS */ + if (!tty->driver->ops->tiocmget || !tty->driver->ops->tiocmset) + return -ENODEV; + hu->hdev->set_bdaddr = ath_set_bdaddr; return 0; -- 2.17.1