Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp458637ybm; Fri, 29 May 2020 04:29:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhMTYV3zEtgxWQCtG89SQ0wdviMx5Giq0rVB4iIEqkSm42WcBEMj2+DBCi+l9hib4Caa6I X-Received: by 2002:a05:6402:c87:: with SMTP id cm7mr7614485edb.96.1590751787793; Fri, 29 May 2020 04:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590751787; cv=none; d=google.com; s=arc-20160816; b=ijGYkGAFzt6pfYu7EpO5tB+FrA55K4TRLu6rVFndJltdG8ybR1s7BnASv04IbnNMk4 MilI3dIjDZQNKIt6z8l4nfPFlncP1lSdh/AGM4SXoPw6yWUpZ8claQYriDc52ke+HffR ilD27W+bGrZSTJHqzLR/E9Jb1bqUybNK3ns9oe5zFCYUDEkiPt75zGyqS/KpdkgkK9Z6 6/HchpNTpV+2Bydhi5Kk5feQ+aC5fWXOjVdPwSxX10HKXgTX46ooXGWzPEiFoUYkanAK IEFICCIxClPMWlTcAdbRxgRJyy0CpGtPbmYeyLiRRFKE0AhLHknfa/5UaoffaJyQJMQy p4Zg== 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=8dgP79jKEPP7MXwHzZbUN9d9FldjpP7lv+/aoMCM0w8=; b=AuUr5KUuBC5TB51/ImW0AHP7Qcddqwziu0iIW24goax6Gmvg1NUe2U8KRxNORF2MBw UZ0srBhZ94mz/xirY44O9aV6YqacbVSo+KmbgIxuDiXmjNordNvLVGsdLVt6ncpydnys K/unzCimGbZP3By7b/VydLJVHNNoEu07A0ONhPSsVVgHTc5WHJodEgjtYjjPX9tIqNC1 TvDmag6o6NTpv6oWxyvpG0/HOU0CQ6qSd+2flBmi4t6ss4Cso7pWHiW97JoVkDtSRYMZ 5lAhG0DL6rW9N+u5uV2tkIkwToF4+Ul58bRzGd8fkegV+i4pIlWYpUq43+Eq0gYdReNT P2fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j6aJEOLx; 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 qq21si5428705ejb.752.2020.05.29.04.29.24; Fri, 29 May 2020 04:29:47 -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=j6aJEOLx; 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 S1726568AbgE2L1b (ORCPT + 99 others); Fri, 29 May 2020 07:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgE2L1a (ORCPT ); Fri, 29 May 2020 07:27:30 -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 4E843C03E969 for ; Fri, 29 May 2020 04:27:30 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id 124so1366700pgi.9 for ; Fri, 29 May 2020 04:27:30 -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=8dgP79jKEPP7MXwHzZbUN9d9FldjpP7lv+/aoMCM0w8=; b=j6aJEOLx37LQfqAoeR/X9q4rItRoAeT0fPUkFBEX7Hli6YASNxJ8UHQFbMxl+5JYtG STQKCElCBMXh1RsorGJgqG3IOtnuRuuqPOuHaOg+julJFcPP0vTUgTAWQzoC4LpbmzPj n0Z7SLDnUTt8r80X8g/FSdnAWUpqoZdNTXR5yFHpo/Rb4Vhtksy2d6cNIZ+7C+WQmu9Z RLHpqIALYyyhRCZucQUFAkduwGAzyoJ2A707AizR2b54at5vFaRsG6aD26yj4Bd9QICO mYaXY8HseNlE5NMYYYnNvxb1MOkgvvSGxLwUN683D5cvNwCVzF6c1OA2QgP6WzS0Dyyl 8F7Q== 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=8dgP79jKEPP7MXwHzZbUN9d9FldjpP7lv+/aoMCM0w8=; b=W/7XKo6sJ15GhXJm6Vb/P+XDSpz8UXPJYjqXzAL4Ih+Jt04FU51MH4ptIfXzCmYhFR 2iTg5bxGwQOrv5w0mMT4gqJqZCDn6xMj/RyRzQ/Q6nj1o7op3aXWjECJtVnqjlZfPIVa SN2JrPng3kIxlFQK6/V3H64zZ9EW+eU6GD85qT6xaKYORsosCxvOFk97NdwLV2Ox33Yw TDR6cTPrdYJuDmF6ivc+613cwkQsIjHWRIoYlyqCcehO93YUJD9RSs1HH/9paaeYSpZ7 LT9pmfVCCIBhtmpLjATbQBAmWPHvryQsqsppfgBezJ7bvtfxjrmNAuRQbtlw59wN2wi6 2fYg== X-Gm-Message-State: AOAM531KvMfUgwQ/OYvAXS7oTi4Nm2jWi3dcK0Nit/2xU6scDG41OUsU q46X1n9+dIXW52rggFIuofhb+Q== X-Received: by 2002:a62:e913:: with SMTP id j19mr8462277pfh.78.1590751649824; Fri, 29 May 2020 04:27:29 -0700 (PDT) Received: from localhost.localdomain ([117.252.66.248]) by smtp.gmail.com with ESMTPSA id w190sm7016741pfw.35.2020.05.29.04.27.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2020 04:27:28 -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 v4 2/4] kdb: Check status of console prior to invoking handlers Date: Fri, 29 May 2020 16:56:45 +0530 Message-Id: <1590751607-29676-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590751607-29676-1-git-send-email-sumit.garg@linaro.org> References: <1590751607-29676-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 --- 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 e46f33e..fad38eb 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -564,6 +564,8 @@ static void kdb_msg_write(char *msg, int msg_len) kdb_io_write(msg, msg_len); for_each_console(c) { + if (!(c->flags & CON_ENABLED)) + continue; c->write(c, msg, msg_len); touch_nmi_watchdog(); } -- 2.7.4