Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4375337ybi; Sat, 6 Jul 2019 03:51:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEzrez7Y1W9cZ+9Rcd96C+Zka4gzlc4uagR6zP2uOgJCJ/6vArHy1DgUFBbMfO+hvPc+bo X-Received: by 2002:a17:902:1566:: with SMTP id b35mr11131199plh.147.1562410281233; Sat, 06 Jul 2019 03:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562410281; cv=none; d=google.com; s=arc-20160816; b=faLb88Q9Yuoh9orG58jaT83+dw+kBCVG8L0jKK0sg1maEH3PuEJFjwDreDWW2w7F/o 6DikAqdKozhTIRqQmQDoIuZlyQAmZkoqukOqwLCbHJIfavyGjnW7h5QVE9KbF/CGh0IE yoq+/QsA8urFaOw6nT0qlXH4QQOOwihwD4ipLSiAEXGlniol/gIwnmLo/PHfJz4//LA2 nWh3x0SV/KbPfeGvHgqoilqWxG/nU1VT8ZvVsx9Id/wgWO0ClTwwIipJlNMZl7U+E/HO FGplcq51GmLTM5YiIMHIWn2eSrMigySgv1q75oilgYxf+Gsc9QqDLR6irpSAZ0GlhhAu AzsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=xXkYh9Ytu/f+6hqCUWKt5oadiDMGcVbU6Dl9euJnf6Y=; b=HcYSPXlKSfOiF+oZsGVfVHduiMmW5Tti2vYDxXUCO2QTFgOt6vH28qXPMwXQ7FDbX3 aWgBKBSqh1xGiK9146qj+6RqNt73kNZdsn51XVxlCcT9rsMGG8YCP2gfjjupnnOC0qSl 053nEHAF1sZPSiVvDEQm3G7O6mQ8FxFC4fpLp3F90ALINBstzjC71elkBNE4BuXo6GH7 FC7ARoEAtnrHe4YokYuVvlhz8QThBwUQT4otOILb/7SgYolhmq60GEygo41rcgYFGxPd 2Kpeit1gi357MPjUK4ndju6O05JyUj/L5FygIXl+mSbmZ2nsrzHDEBaRe/9JFPWTJm8O gZdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q189si10814775pga.156.2019.07.06.03.51.05; Sat, 06 Jul 2019 03:51:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726016AbfGFKtR convert rfc822-to-8bit (ORCPT + 99 others); Sat, 6 Jul 2019 06:49:17 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:53714 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbfGFKtR (ORCPT ); Sat, 6 Jul 2019 06:49:17 -0400 Received: from [192.168.0.113] (CMPC-089-239-107-172.CNet.Gawex.PL [89.239.107.172]) by mail.holtmann.org (Postfix) with ESMTPSA id 19908CEFAE; Sat, 6 Jul 2019 12:57:47 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH v3 2/2] Bluetooth: hci_ldisc: Add NULL check for tiocmget() and tiocmset() in hci_uart_set_flow_control() From: Marcel Holtmann In-Reply-To: <4cc3a826614822661dbedad74d9970172cbfa6d7.1549346039.git.mhjungk@gmail.com> Date: Sat, 6 Jul 2019 12:49:14 +0200 Cc: Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <4cc3a826614822661dbedad74d9970172cbfa6d7.1549346039.git.mhjungk@gmail.com> To: Myungho Jung X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Myungho, > 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; > + lets just fail setting the line discipline if these ops are not available. Doing some silent ignoring is not going to help. Regards Marcel