Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1194960ybg; Thu, 4 Jun 2020 03:38:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/OB1fwgSAaWOwYvXigHottQFrdat3d5CRpaEcarC9XYUqcgeq0IMrxSBv6e449vBrUwN5 X-Received: by 2002:aa7:c254:: with SMTP id y20mr3621405edo.363.1591267111673; Thu, 04 Jun 2020 03:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591267111; cv=none; d=google.com; s=arc-20160816; b=oPIM2t2VmFNET1DE3jSqkCtOWfbQPj/1q3/Fjv+KGQ19+5nWyKOTno0HMr/9CVuZJY A+kbM8i1sf3PgAAoHbeU6X0ev7Wro3VsCMGy2Z7Eki7+0LzFvyzu6qrBaFofZMMd5jkr MkoD/aqBDdmnLUD6O7maLz7dghgyo1xBH0Jhmj/dbgstSpv4f4gpuYr10QGGL4u9Ss2J 5JUWWDKrvFi5rk92if5lQ1BF01CcrduQAKV0JqHYWBH0rB7RoT1yxW0fT8ou5LfUb9CF TaU8fuUW/tHwLPtQ2kRliwwzdwHfaHHJ+g93yRoEVM4GGakXuHHPZW2im6vShIwHRgd1 5/cA== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=lmlB+pXtYmTxvOHVpxLinB7XLVQiN2it0eFpYDWFPp8=; b=dndav9XBEDMHycg2lx0TGAR/jINsBJZcor/ZXgpi1hqXDyZQ15Oh64yKCGdk6f9Q4z W/RciCvioRLZwd+M/Zvnyd09A5JbwkbJaWj+SPg5qYl16ByEF0FUT02vQJZ9Pj8Px55S WbVNjNKmljpzKdNIBT8Lip3Q86fenw5MZa6egW7Q2VmV1eSYEhvDj51Wmq9vUYmqm2o4 yzboj+zcrxn38gdZEJI0dhmMUojJ5ykfT7eu1MeJIqCK5FKvdmTJ1YQ/jR1YRYK/OlDT ntKymSLj8vXgt5k7bRk3aw8N2WHZlG8slIsxRK+P05mvpZsWdF0N6xyJ3c4VObmwfv/0 GrNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IGSSRmtm; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id um1si1438054ejb.200.2020.06.04.03.38.09; Thu, 04 Jun 2020 03:38:31 -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=@linaro.org header.s=google header.b=IGSSRmtm; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728405AbgFDKBx (ORCPT + 99 others); Thu, 4 Jun 2020 06:01:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726411AbgFDKBx (ORCPT ); Thu, 4 Jun 2020 06:01:53 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57ECBC03E96D for ; Thu, 4 Jun 2020 03:01:52 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id q16so2010744plr.2 for ; Thu, 04 Jun 2020 03:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lmlB+pXtYmTxvOHVpxLinB7XLVQiN2it0eFpYDWFPp8=; b=IGSSRmtmpdky3rgwegSDEySfjuUJ2LVkZV2xvh9aO93mhqax8N8nuxhwVcjz0b/Gcj UIcAq42et3lewAn4TsiQ7+VifsxhjDGyyqPtVs5/a5XOE0WT+Bp1Pdg0AwHtH4LHE2MA 6A2XNP2cgCaD73tESkCFaRfbF2IKmT9+QPQoH08drKD7PnzolRphdcvNbhybGzCipgIi yEA0I+tF7hRDBLwdKCBP3FDWVwDY2v5KqyF9F4d0EO44R7kc8AmsR003b0E1dN8ddppR 8kCKr6SVXDDA2wMx/zghCP+uhvJZRsB0XeLQ7wyMMLdMoWQ7/mkWn8ul6E2sdKxPgklT n7fw== 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; bh=lmlB+pXtYmTxvOHVpxLinB7XLVQiN2it0eFpYDWFPp8=; b=Rp7BPNTDohDOqaK7DeToQub/kFUmizUyYksWVSZMjKPXf+c4DsLKrYqxmvPXj9Foqh 8pdv7Ts1enN7TQGb9jL2FzG9GKKUFIoep9UxeCbyIFIBCwI88L2iTuEn2Oe+jYjKaNF4 4IHE5d5/HBu0LdNQenS3YZoQC0QF9E46yYiIfsmXmOjJU0QRReYCrSmDEB73NI5593R1 UXVT7Nyy8lTGO/l0qqhucCL0OqupHdrvOuF7K6PfaNS+ikCUvLf6bATrfpodDdK0MSse zJhBxZlzE2eHwWiEpwDYdDYyiRNtf9xZcdINVM3QPKX6EWufhN+qBdoLn4DipAEywVog t3Jg== X-Gm-Message-State: AOAM5311iMUDm+K7nTVEYtiHSHBwnrZmki/G9lHZ5Hmm8hJrnLyMiUCx CY+t+R4jX1XYPZ0ix+a5g6hSJQ== X-Received: by 2002:a17:902:47:: with SMTP id 65mr3843773pla.54.1591264911843; Thu, 04 Jun 2020 03:01:51 -0700 (PDT) Received: from localhost.localdomain ([117.252.66.248]) by smtp.gmail.com with ESMTPSA id np5sm5786992pjb.43.2020.06.04.03.01.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2020 03:01:50 -0700 (PDT) From: Sumit Garg To: daniel.thompson@linaro.org Cc: kgdb-bugreport@lists.sourceforge.net, jason.wessel@windriver.com, dianders@chromium.org, pmladek@suse.com, sergey.senozhatsky@gmail.com, gregkh@linuxfoundation.org, jslaby@suse.com, linux-kernel@vger.kernel.org, Sumit Garg Subject: [PATCH v6 2/4] kdb: Check status of console prior to invoking handlers Date: Thu, 4 Jun 2020 15:31:17 +0530 Message-Id: <1591264879-25920-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591264879-25920-1-git-send-email-sumit.garg@linaro.org> References: <1591264879-25920-1-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check if a console is enabled prior to invoking corresponding write handler. Suggested-by: Sergey Senozhatsky Signed-off-by: Sumit Garg Reviewed-by: Daniel Thompson Reviewed-by: Douglas Anderson Revieved-by: Petr Mladek --- kernel/debug/kdb/kdb_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c index 2d42a02..58b7d25 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -560,6 +560,8 @@ static void kdb_msg_write(const char *msg, int msg_len) } for_each_console(c) { + if (!(c->flags & CON_ENABLED)) + continue; c->write(c, msg, msg_len); touch_nmi_watchdog(); } -- 2.7.4