Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp2592652ima; Sun, 3 Feb 2019 02:54:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN7fEfzIhM64Q6xAQVUs2b+g8kfJYAlr5WjWl3RNRXUvrT67PrAe8mz7tVVLhvjim4dZoUXy X-Received: by 2002:a17:902:4324:: with SMTP id i33mr46177851pld.227.1549191240373; Sun, 03 Feb 2019 02:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549191240; cv=none; d=google.com; s=arc-20160816; b=xvuBqYfp0qSC7HDrpRcql7zhOMc3Ob1hWFn5WgjTB4ikWKRqNjLXO6PEROoT9NUJ7j Yu31g41fEx2B3rO9zrpDi4xYQlzKhCJm3UtxwUz2CLpKzMrMIG1DNFdNFzREpjngWIrR rma2QCZUEcyrAw9dqJ2sWVjaVidJPcUBF3jmJ1zpHTXSipmqDDoMk3b191HcCks/aLCJ 7GMkVg9vL6cTrbGxWABFtnRB9V9jSUyaL6fl76NsHoD/Dw9Y2l5h8FH/exA62w9yhqI9 eHhJQhlbx2IF78vSUeeN+CdpzpY7kqME+FRgm4D7yXs0YHVN+y3wT5Mc71qVhE/hwa28 z2VA== 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; bh=mevyq5vjK3YVqqJp1vTJff90i2EWe2ZEZND8e2Khv3Y=; b=u5629Lzf+/rPtiD+Hm/VHJRLsmiySEPasgOPLJcjE1RSrl6730FWCcKukcc+/wyVQ3 5ZOk0pu7AQ149Pb6w+IiKAvpv+SSsz40D/rBi1GagjkPbgut0DnB+qauNEbvHe2cZhIV xk4svHGZCPZ8rCb1bUSBIthGJGF8APoQAG9OndwL7+fgxYNY11gkOKaf7Ha6n8wXHOoV eeFlTft1T77Ctu2myLcMF/nnV1cFmzTB5vvDOrp9n4l11le7xqWUoZIDyQzsiRUImpXu rRhgibjWYnSK+1GxxKw7khKWodjPzLfqcLhdknfkLUbmeJiJMgA4T0G6bBJTa14E3Wus 2h1g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22si9137231plp.301.2019.02.03.02.53.44; Sun, 03 Feb 2019 02:54:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727614AbfBCKx1 (ORCPT + 99 others); Sun, 3 Feb 2019 05:53:27 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:44519 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727204AbfBCKx1 (ORCPT ); Sun, 3 Feb 2019 05:53:27 -0500 Received: by mail-lf1-f68.google.com with SMTP id z13so8189491lfe.11; Sun, 03 Feb 2019 02:53:26 -0800 (PST) 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=mevyq5vjK3YVqqJp1vTJff90i2EWe2ZEZND8e2Khv3Y=; b=ZqQjTXQLj97fnS56vYav5oPziAbKVYLUTb+QP70tz+xxtysL3VxA7wS/S/dVDurHCo LE6Aw4HILI4u9du9T9JQvm712f3Gcnsyyv/tXOZXWIx5D3kc6yqqUl/gP9CSxnorOWv4 FAPzpVm/ahH12PIBxGShg2hDWakgJyFJWSpWvX2gXBOJCV/7Uk4CwCrsbvFL4CKhAJ+Z WvtU4Kr4zGsy/3f7oZun3oYx+yKyOp4rgzP/nHaqPgMYc4m6N6qUE3ye6059BlfsHC2h 8kQsuZbKEktogfQAw1gxtUKxfPLUJ/s55UlsnC6cNfr3Pt7dSZta7r4eB2ffMZHtSVxW g+gA== X-Gm-Message-State: AHQUAuZ8c0+RaAJ9KWCOPQwUg7wSYTFBhHcpYkLFu4524SyxwOzSQB70 1n33TX5FTiA5oBqDuKNGhDPAsJVv X-Received: by 2002:a19:5601:: with SMTP id k1mr14860890lfb.99.1549191205108; Sun, 03 Feb 2019 02:53:25 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id g20sm687226lfh.33.2019.02.03.02.53.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Feb 2019 02:53:24 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gqFOt-0005Vm-KB; Sun, 03 Feb 2019 11:53:23 +0100 Date: Sun, 3 Feb 2019 11:53:23 +0100 From: Johan Hovold To: Myungho Jung Cc: Johan Hovold , 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: <20190203105323.GA4686@localhost> References: <20190130053925.GA26699@myunghoj-Precision-5530> <20190131154000.GU3691@localhost> <20190203063823.GA8228@myunghoj-Precision-5530> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190203063823.GA8228@myunghoj-Precision-5530> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 02, 2019 at 10:38:24PM -0800, Myungho Jung wrote: > 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. Almost right, the format you use above is actually used to identify dependencies for backports. You should add a Fixes tag identifying the commit which introduced each bug and a stable-cc tag. If you want you can indicate the version after a # sign, but that can also be inferred from the fixes tag. For the hci_ldisc fix I think the tags would be: Fixes: 2a973dfada2b ("Bluetooth: hci_uart: Add new line discipline enhancements") Cc: stable # 4.2 You can use git blame to track down the offending commits. This should all be explained here: https://www.kernel.org/doc/html/latest/process/submitting-patches.html Johan