Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1234249pxv; Fri, 23 Jul 2021 03:25:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoNNGtVR0yg/XhtBV2+QUcmWR5wTNiM9E5Ve1TthnyDmYiSpHlpVox93L+t6p0wNc6pt+N X-Received: by 2002:a05:6402:190c:: with SMTP id e12mr4615968edz.176.1627035954064; Fri, 23 Jul 2021 03:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627035954; cv=none; d=google.com; s=arc-20160816; b=nWCIZzgkwslbMpCerty0nYVIAXAXmBQu5sza33ZeiVY4P+U/TTTkBgxYT3YFGACc58 alLRMhUGjPguc3U1ctBI/RcP/a7aVktm4/+lm5wdtmEDjs/Ix0iUzrrCJpUAw6cbdXuV /FS9i40YrfoALy2/tb6ro1qQ8rwND0rV3ySfZ7rPzFSqtW+eThYmIlis0bQWDUI5nyD/ FDlXCbLfysdDYOoA708hhUi9m7t8yjMynpHYEHJjyeVk/Ee/dVrqrhnMMvxCPTzLCE6g be/vFBkjM0+aXep1gYyZD8CEbnBhZPWEottxIOOfMsG8fMqgA1A4DAIBfqByRQlb0EbY g0Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=D/djCiTbrGETxvYGjnVxeVMMBE7bXoe7yIRvnCe48DE=; b=FSXHBHdJN/xsDByW4kRmV0EMZeGrviCYKRwHWsvqj6xv8u7y2nvakFpL7biYz9YRtd zyT4NEUIb2/1CVz8qaQQFQUIX1BVbMHtm91fcstVo11b0DCHpqfqccScARrCXmaRBw1f NpahkSJEkzxC5xjEjTDmjo5whD4Idahm8MpvELCAEzx6Yo+jz+Dxw1VosSD+ZpwqwiVA bpQQk23t/hbeZbAAFN4cIPBLJKaf/q9hi2r89KgNr6AOqVi8Y37g1MLCaK8hiabPr8y1 aboezI0K/gUzCfqXAPrRQtmbJTbcWT0nwOOOFL9pKFdjGmizTR64j4vCR4l8AnoGPf6w mMLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HIuHnT8w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id l5si31916148edw.446.2021.07.23.03.25.30; Fri, 23 Jul 2021 03:25:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HIuHnT8w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231871AbhGWJna (ORCPT + 99 others); Fri, 23 Jul 2021 05:43:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbhGWJn2 (ORCPT ); Fri, 23 Jul 2021 05:43:28 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE46BC061575; Fri, 23 Jul 2021 03:24:00 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id k15so1078692edq.13; Fri, 23 Jul 2021 03:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D/djCiTbrGETxvYGjnVxeVMMBE7bXoe7yIRvnCe48DE=; b=HIuHnT8wYqA3ahyCSoMC6gdXQnV2KbabsexS/cLWPqdHVFrvWMoVDxKESPmBKQ/Svq ssVl2LBjIow3tvsQY82gaZ4T6UGmco/t1VHsB5pGAZPeJ70r9KlLcU+lOfpV8anfBfhb klUu+RJIyC9toQY3JhoUvz/MeR2J4gceyMZzNMhj0OwkGUsXZcHAQypWDNZe05kj7sDB TaiBdZlFW5HA/G6jjZ/sFVrPOTbW5pYb65w6rqPVb+eqQRBiq7bVrC6vs8wzIwZhmakF 8AO6G82RB793w34TSO3+gcPDAM9T4gQKq4GQsCJf6l2SREsUGxUilVSTG70QCt6DItaO 4OmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D/djCiTbrGETxvYGjnVxeVMMBE7bXoe7yIRvnCe48DE=; b=GPk4IYu69Ip4P2xnjxnTHMYxBxkM2lwB+I+j+ASs4FOx3qYVlaVss/7kW2MGdM86by m4IZxQmatDtYtxrl9J76fCXsy1X6ZX1c1FeGgcaJKkM5sdFgYy6NbAziRxvDjEExjzLh APyz//NJKkqkrhPRySeIkWV9UpZF3VFjudvwW0Ss/yZb4x5A6i/+CWalYjsUzguzeG95 v8GOnwAnvB93cVfyIXUhQyr4OH5kbifc/c/FYECk43rRKSJmLBYJz4qJuvvbEJ1POOCe pzKSkoWaRFSHCrj7IzO/xuAPp7SdVPOG27qPhkJETWyxGoeuDhoUU+x9r7qzXOWGyhKm OXSw== X-Gm-Message-State: AOAM530LlABoN9QzUsAyMusbSvMMOAF1U6jkAhXAFmYOP+wlfJ9nr3gm 1pprHv5II446Yy0hZBKOrnEN0mrS3FSTpleBkDU= X-Received: by 2002:a05:6402:26c5:: with SMTP id x5mr4711094edd.237.1627035839567; Fri, 23 Jul 2021 03:23:59 -0700 (PDT) MIME-Version: 1.0 References: <20210723074317.32690-1-jslaby@suse.cz> <20210723074317.32690-4-jslaby@suse.cz> In-Reply-To: <20210723074317.32690-4-jslaby@suse.cz> From: Max Filippov Date: Fri, 23 Jul 2021 03:23:48 -0700 Message-ID: Subject: Re: [PATCH 3/8] tty: don't store semi-state into tty drivers To: Jiri Slaby Cc: Greg Kroah-Hartman , linux-serial@vger.kernel.org, LKML , Geert Uytterhoeven , "James E.J. Bottomley" , Helge Deller , Chris Zankel , Laurentiu Tudor , Felipe Balbi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 23, 2021 at 12:43 AM Jiri Slaby wrote: > > When a tty driver pointer is used as a return value of struct > console's device() hook, don't store a semi-state into global variable > which holds the tty driver. It could mean console::device() would return > a bogus value. This is important esp. after the next patch where we > switch from alloc_tty_driver to tty_alloc_driver. tty_alloc_driver > returns ERR_PTR in case of error and that might have unexpected results > as the code doesn't expect this. > > Signed-off-by: Jiri Slaby > Cc: Geert Uytterhoeven > Cc: "James E.J. Bottomley" > Cc: Helge Deller > Cc: Chris Zankel > Cc: Max Filippov > Cc: Laurentiu Tudor > Cc: Felipe Balbi > --- > arch/m68k/emu/nfcon.c | 27 +++++++++++--------- > arch/parisc/kernel/pdc_cons.c | 28 +++++++++++---------- > arch/xtensa/platforms/iss/console.c | 33 +++++++++++++----------- > drivers/tty/amiserial.c | 35 ++++++++++++++------------ > drivers/tty/ehv_bytechan.c | 28 ++++++++++++--------- > drivers/tty/hvc/hvsi.c | 35 ++++++++++++++------------ > drivers/usb/gadget/function/u_serial.c | 32 ++++++++++++----------- > 7 files changed, 119 insertions(+), 99 deletions(-) Reviewed-by: Max Filippov -- Thanks. -- Max