Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4680632ima; Mon, 4 Feb 2019 22:43:51 -0800 (PST) X-Google-Smtp-Source: AHgI3Iad/ayadGoiVG0fNWQ8wFruJqTHp3BqBGRsS+0oLD8wS7kBb2bcBL9yl3EnhPEH+mwaPRy8 X-Received: by 2002:a63:5463:: with SMTP id e35mr3139123pgm.260.1549349031764; Mon, 04 Feb 2019 22:43:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549349031; cv=none; d=google.com; s=arc-20160816; b=dyMg29O82hja/tCy4x/pYlgkMnR/6RmN6vt2MhKjy1Us/eTvf1mUlZ6VfCZBplXQtr 27A/6e8G/+6MxiQ3IaCc2UDgvD4fLMz8cAtkTx+gHgydooxkHwip07+n7XjZCVynE+t4 JxcSfiXpP89jVafTQ8j03WUuQcK/2NrKQduUciEQ/RC0YNKho3W5R/cvD8X99YqixNfP 2aLoPjWF5vevzLWxDxNUky6qgJJEwEtc4WI5IDmtMWXALv1jmmJHwyHFmZ35LQz7M2Wn dyPVpX6SwcNsO425mBLZUynqR39Iejr4IVRMRjpphrmvpd6MbMrBH+yQFTVgMP9NFP7J 11QA== 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=rRbBcTZq3hXfWPWoeJVSOfiF3bXYvYeCff1R3IhwAC8=; b=n6hoHMz1gfOhY+0p+wVpry8bFiyqFrKAmTBz5JJ6r+f3Njw9NCmAEaOT95SD5rCxfq NPB0R1PHO7cZtgFVvFwxtAcLz20Fap+wjbFhs1Vpkl73TndocjQjColcBQItA9xjciBd LFPZxq5B5OvWup+rwDz8EYV6y46wHTsoqDcxpNO+6wmxxVhix7JlD5/ZqEGpYzmPD6JU ruCa+r3e/kqN2gHMm1Yq4fzmTzUjwAAyjQaHn+W6qgYgORaMAh9sVDFqddAHEwjxcNSG /8hmyx10f0C+GVvAOddM94MAAWkvoVWm1NkIE2lpn7kIldEmPcvDRIDcPs9NZ429fC2k myMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M9+cbqU+; 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 3si2441950plh.177.2019.02.04.22.43.36; Mon, 04 Feb 2019 22:43:51 -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=M9+cbqU+; 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 S1727934AbfBEGnS (ORCPT + 99 others); Tue, 5 Feb 2019 01:43:18 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38820 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726416AbfBEGnS (ORCPT ); Tue, 5 Feb 2019 01:43:18 -0500 Received: by mail-pg1-f193.google.com with SMTP id g189so1010554pgc.5; Mon, 04 Feb 2019 22:43:17 -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=rRbBcTZq3hXfWPWoeJVSOfiF3bXYvYeCff1R3IhwAC8=; b=M9+cbqU+hIe//yTDYjhRCUQXVy8Qreh2/klscRx7XBQlIbsGhTlxNZxux0s9VWK39V uYAte7K+2oGPckTV/i7/fQ7VruPGVwnkQbXMlgOZnRxYRvqqrj478ep86xlH06d+r4Uz ZZWLpVno/KOhCqUU6BvfJV3wIPi7HoxjX2GUQ12YGwr06JxlgC4GgG8f86c7xfYF3QNG 38qcibROb2VWtfl5WBgmbJllDPGocKrTnP8i3HAaYHR72qVWZpvvF8bZ6ZzbqTUruXDb yJIlSxbdl7GYO9g+2h2wfBgjGDLkkiMnVxxxrhX7n/HI0Q1dxYXh2O0xK8qbhuZ1wk+7 obUQ== 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=rRbBcTZq3hXfWPWoeJVSOfiF3bXYvYeCff1R3IhwAC8=; b=K9j4h6e3Ppki29MsL2iW6EULq7PlIuGZOvsv1q2N7FoyvGDza4Cvpt1spZEO97wfIr XW1mMobszjyQ+u1uRmgRL4uV299DW18+3V0QA/YCcQkD6cJAiRfbMMva1x04Oy9ERemU I2v+Zs3nBH32PCJ09JfpcZNbpQtolEkkAFwo+AZmQTcP+rOXgtkS6/1BiwHm19NAriSd lO969ka53QLU1knkamWvJ5hkOCzHkd2D9P93IDbeBwnX9amsVSaC/a8bAEW6GZl2CXLH 6wotinPgpz7zjV+9fJn0AU7WSVsTttnf4VNH799uWpdY28YXgLnHOj9WB/XjfU7sFSrJ P3uA== X-Gm-Message-State: AHQUAuaJ2HsmnWfrebhRro/zdArEHexH8Th3JJG64RZfQMqHLiRMpQRU wdNLDqh7UnBl2/o0h46CgI8= X-Received: by 2002:a63:1f06:: with SMTP id f6mr3168834pgf.414.1549348997376; Mon, 04 Feb 2019 22:43:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 22:43:16 -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 2/2] Bluetooth: hci_ldisc: Add NULL check for tiocmget() and tiocmset() in hci_uart_set_flow_control() Date: Mon, 4 Feb 2019 22:41:42 -0800 Message-Id: <4cc3a826614822661dbedad74d9970172cbfa6d7.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() or tiocmset() operations are optional. Just return from hci_uart_set_flow_control() if tiocmget() or tiocmset() operation is NULL. Fixes: 2a973dfada2b ("hci_uart: Add new line discipline enhancements") Cc: # 4.2 Signed-off-by: Myungho Jung --- Changes in v2: - Remove braces in if statment Changes in v3: - Split into 2 patches - Add stable CC and fixes tags drivers/bluetooth/hci_ldisc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index fbf7b4df23ab..cb31c2d8d826 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -314,6 +314,10 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable) return; } + /* tiocmget() and tiocmset() operations are optional */ + if (!tty->driver->ops->tiocmget || !tty->driver->ops->tiocmset) + return; + if (enable) { /* Disable hardware flow control */ ktermios = tty->termios; -- 2.17.1