Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp287174ybg; Wed, 3 Jun 2020 00:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRhrHtUO7lu1PNHBNRRmGOLWIooTG5IGBDfz8XuCBrclw/9vhppBV0puS54UB8X2ArYdnR X-Received: by 2002:a50:ee08:: with SMTP id g8mr4936771eds.267.1591169117115; Wed, 03 Jun 2020 00:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591169117; cv=none; d=google.com; s=arc-20160816; b=YFVLduQnsvAAbxnvFSsri3Wk9cfZFHL2X4oH6Z+qA9YEXwVRuffI6Hn2zedb6T60XX WGydzK/YE1cBFhChlzFw+QjPN046+WV7rnj9J6t2g/Ye6192D3XqydBW+1R8iRq7faeZ zKxYmqHAVTwKITdGxx88IKs1fUIls3JPQx4Psh2kVLFW4rf/o13Ms45v6qbnm1Makfmk TQ7jZCxLowmEVTEsTmrarQLYSiRFzUndhb5VC4/CLCqmIQIcd6E+v+5BwDNDoS4Md7cP SSksa4BhAXAAAs1VZ5jFDyQUXq8KjbIwfWD6/eqFX7BAUQkeg0/5VxyMLe308OsoGLRm lfLA== 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=KH9mdDVcPHEY0mojValvd3JCyi55UJUFJ61D84czA9Q=; b=EYczE3j35zYAq72fDQcp1OqsoR4FIweV1Tlgz9kJjCun40E3NFYvHTUhBdlllikUXJ PiLOF8LaFEIQa70XBxb/6/RpEWBT9WrBU+vHMvSsaAwRAHABtBjPc3izgQmNAUibv0Tl MZzVbrZ67s213Ud5g49HteYKhlNEy8giRrTt+3i03nQOqJ+v0M29izJOreI6sKTeW0QN 88ISy5eHh9+v3ozh16QznyAvIRi8rRtaZuOG/V5lQT4KxO9yItFBNEByAeZSJX/Ey9Uc Wk2fZJH2u0Vtuc6MVxEh1jN8oB9QBKD85TrP3e98M9hF3cNW0hqDPHSwTrDTfDREy6Je ax5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I0S3XYU+; 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 gy17si659076ejb.244.2020.06.03.00.24.54; Wed, 03 Jun 2020 00:25:17 -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=I0S3XYU+; 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 S1726167AbgFCHWu (ORCPT + 99 others); Wed, 3 Jun 2020 03:22:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbgFCHWr (ORCPT ); Wed, 3 Jun 2020 03:22:47 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB24C05BD43 for ; Wed, 3 Jun 2020 00:22:47 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id e9so1134880pgo.9 for ; Wed, 03 Jun 2020 00:22:47 -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=KH9mdDVcPHEY0mojValvd3JCyi55UJUFJ61D84czA9Q=; b=I0S3XYU+nNeK9ISWU1458r0kuMd3K6rN3SacyxgQr4DuSLAFPR9t4UhOauqbuhZ20a yPdlKC9njptkxgd0ZbIPtSUEepv9SglcMj5d0r2RY+ztemInMrrqQMKxZy3fxHIc1dpx N0G4bvRaNTwS68qdSTC/GjutgZjwd4gPu5FvrAn6s8S2iYs9zOpr3G7CCJ/n42dPfe8z x158WQg1stswQjoqv9wfJBP1i7XSDB33JFHoVujRwZvQyvf3sCN+rO/94JYQUWrF7h6p laiQKIEttSSC0ugoS9IaUiwu5Ob3mP8NiEE3NCuC88Yb5XpYdDCngMAGq6NVoPUMlPjK wEIQ== 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=KH9mdDVcPHEY0mojValvd3JCyi55UJUFJ61D84czA9Q=; b=QY/y1T6oJQiP+U74qTE9G/0OXZ5YwyOb0nkTGI5euXMhXlA407iFEOWHLTdMqg83qJ FwEmceFuqn8xw17ZETGsI3Yum0g23PeYKNyi2DSKU4Op9Zj1y5vrbISUbsFRoULRJ5zM WtswH+jPGHgPnfPgdApbEV1gbw8D2cCFPhNtmI6/erHNqLYq1it8sdDou5zhHcfF9QuU dL0duFE03xPCHGrRgXcDJ2CZC/cy+Gerverl2AsjvcdC7cQ1W4BDEvLW4M6fhHa2BCIM NKKW82VZm5S0/hECUO56CzuEyQN8mg1ic1OzT7g6nduX6c0l+ijVexdekitQcCiAYVI+ VfHA== X-Gm-Message-State: AOAM533GFfiM7KB62W2TpHLKRujhpkhNyjZ3IIJV++6lNpY/Z2f8lnBV qV2DgPAKoqcgNL15+kLOktehBw== X-Received: by 2002:a17:90a:f198:: with SMTP id bv24mr4099950pjb.206.1591168966618; Wed, 03 Jun 2020 00:22:46 -0700 (PDT) Received: from localhost.localdomain ([117.252.66.248]) by smtp.gmail.com with ESMTPSA id j17sm1407272pjy.22.2020.06.03.00.22.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2020 00:22:45 -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 v5 2/4] kdb: Check status of console prior to invoking handlers Date: Wed, 3 Jun 2020 12:52:13 +0530 Message-Id: <1591168935-6382-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591168935-6382-1-git-send-email-sumit.garg@linaro.org> References: <1591168935-6382-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 --- 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