Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp2425430ima; Sat, 2 Feb 2019 22:38:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IYdHXQTgz4siEhyoIrrNnmnFVEmYx7PKsl8JKGIMxOo0/SR6dIieSsDCLjUoVjY9DP8MB40 X-Received: by 2002:a63:2263:: with SMTP id t35mr8582858pgm.69.1549175932268; Sat, 02 Feb 2019 22:38:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549175932; cv=none; d=google.com; s=arc-20160816; b=Zt/Vtyjd8mI4PH7hbMOON6Cec0hYLI+vL0DXMlgpSll210OXVMWfFz/aDP7z5PYDWK /BMgXUfqwcX0K2GQZza2NSrmIDkg57qIMs1rktYRmJlbOyY5tsN4AFBz3MSmJC+JDhPo LAzUFeIr9Yh4WNoKCPTHOtwcjmNpQot+emjoEzbkcjz24lk1Efzb6zQFS+etreOOj/qI Eafekzd4TxKAikhujt+Y15hCJYPyKdjIkxHADjxRKfOpQqKxqMobwgjUd/JfTQMkdvTs 2F8W74vdhd5bAV8JxhQIwm0jK0jqHhkjEnlz9e6lzgzfegzB8bGbVZOnQI+hNbjKMCOL C3gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5HfheAJSIQlHyMRAytqF17V6asDCHPQD+Fbosi3E3DQ=; b=ibDwTcZF6rUFzjVsOrIEKNxVTDkokXOU0/RF3LnO0O6AAJ8W0qfxpPvXreYd+Ia+wm 3Y4kecmKgJNrrPP53harytEDHrpX65LnKonw6CHWRYb8HOO1tbLTB0GSn0KopfSXPj9p F9RwLFZ2IvCQUhvSQHavVCYJVQ7eA5BPQiHdkgY/k1W0rFFPpV9kI/wc4BXjF1ZdJY4y ib+HMI1hJ6cQmhoqNSEU6NdjRzGSn6WUvrCO4Nz605bbuZDIa+yTwhYeZOMjzoCwJk/y l30t1qu3fqCWAzirkQaDCm68A0+U2xvnB5H2pj2FOAmITf85pDfCs9Lt1mGlyeksgeTq aJtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IrNXccpE; 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 33si2019729pgn.230.2019.02.02.22.38.34; Sat, 02 Feb 2019 22:38:52 -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=IrNXccpE; 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 S1727025AbfBCGi3 (ORCPT + 99 others); Sun, 3 Feb 2019 01:38:29 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34702 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbfBCGi3 (ORCPT ); Sun, 3 Feb 2019 01:38:29 -0500 Received: by mail-pf1-f196.google.com with SMTP id h3so5317879pfg.1; Sat, 02 Feb 2019 22:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5HfheAJSIQlHyMRAytqF17V6asDCHPQD+Fbosi3E3DQ=; b=IrNXccpE5kRnoRTzacGNFflnnYaDQNE3KeFSbH3yi3DkB+Ny1u17rS6E8pMdtfRT+0 3j4ocdAl7la8XQcep4K+Cv53i2KkknRixzWozkrNi3ZvoKPM81MlgnmcBklU2q3+0BS4 rxOTUgiyVax7ncXTX5FNXYgNBSPIE9QebmLYeeOXArZIaech3tO4fb0VZlxQQTG7EiHz HdkjtOMznrrcXJjGWuIEhSXJkeQylXQvxjIcQVELX0J2JJMeNkoDyy8dplTaVywPLgv+ Q+r1pIAAf2qHcTlICJGASrEermXlUx1h7Bsd9gn3h6c4Z82qkstaFcyM9sjc5gdlisHo xx8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5HfheAJSIQlHyMRAytqF17V6asDCHPQD+Fbosi3E3DQ=; b=g55FqLR53Np6mKZ3U/Dxip1T2eLgaff4SWvZqS6vTfCWyjAul1PacWMzFeK9Y+Epzd BrUuHV4AEhLLg/uRQCGRXCvFkTl8n3WcbSzGMCw858r6THBP0oVgg5twKVQFWZKws6Am 5YCgM4LU8oCs5ohHTrTUk0JZyUDlY7i6UVA95CQMFCdMrd75auGY5SBQXzpG0cTSwR4E M7GXblChl+UEUAKGWW0bNCyiTAnibr4/sm1IZEVBgjQQWe/k5PYOJOgiwbvcYVlj7D0p YtQQFekzXX2GWmaNA6vVjobqAe08wzXKcUXr8kq41CBHrLKQzyoL/13zZMKFhVvjdF8u hLDg== X-Gm-Message-State: AHQUAuZdG3BTt+bsBWGLz3/4ofo3IpksRuSuCIN/fFT8UuxIqHw560Sv moQzYWZQc0SdNnowt0BlGDs= X-Received: by 2002:a63:e74b:: with SMTP id j11mr8663200pgk.397.1549175907854; Sat, 02 Feb 2019 22:38:27 -0800 (PST) Received: from myunghoj-Precision-5530 (cpe-76-176-3-80.san.res.rr.com. [76.176.3.80]) by smtp.gmail.com with ESMTPSA id s84sm21704138pfi.15.2019.02.02.22.38.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Feb 2019 22:38:27 -0800 (PST) Date: Sat, 2 Feb 2019 22:38:24 -0800 From: Myungho Jung To: Johan Hovold Cc: Marcel Holtmann , Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Bluetooth: Add NULL check for tiocmget() and tiocmset() Message-ID: <20190203063823.GA8228@myunghoj-Precision-5530> References: <20190130053925.GA26699@myunghoj-Precision-5530> <20190131154000.GU3691@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190131154000.GU3691@localhost> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 31, 2019 at 04:40:00PM +0100, Johan Hovold wrote: > On Tue, Jan 29, 2019 at 09:39:28PM -0800, Myungho Jung wrote: > > tiocmget() and tiocmset() operations are optional and some tty drivers > > like pty miss the operations. We need NULL check to prevent from > > dereference. > > > > Signed-off-by: Myungho Jung > > --- > > drivers/bluetooth/hci_ath.c | 6 ++++++ > > drivers/bluetooth/hci_ldisc.c | 4 ++++ > > 2 files changed, 10 insertions(+) > > Ah, you had already submitted a v2. > > I still suggest splitting this one in two patches and that you add a > Fixes and stable tag to each so that they both get backported to stable. > > Also, when resubmitting, make sure to include a short changelog here > below the cut-off line (---). > > > > > diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c > > index d568fbd94d6c..fb9f6323a911 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 -EOPNOTSUPP; > > -ENODEV might be more appropriate. > > Johan I'll split into 2 seperate patches. So, do I need to add stable tag on each patch like below to be cherry-picked? Cc: # : I looked for a good example from mailing list but didn't find one. Thanks, Myungho