Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp585686ybm; Wed, 27 May 2020 03:03:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9h1rWeAwxk1Kf76qQrGIFpiJ/nRAku8hMMXcC89PofoWygA4GsUB+FQn30gLisF5piUKN X-Received: by 2002:a17:906:144e:: with SMTP id q14mr5262687ejc.450.1590573825283; Wed, 27 May 2020 03:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590573825; cv=none; d=google.com; s=arc-20160816; b=ReELWNA7R9qYEq6FvWixYNefeMu69CQU+rE/bVfigWrklEBYP4MCDvFabcKJJLmZnJ TKtjoKWJtgkLzzzIdLH7KR+V7/HTCRQYHWZV8JfkQpK/w7vZDiO6nySydN80rtuK9eOT a/LzlW/FXqzlMbg0HKOsxcMVXdiqHztNVr1+vwU9APuKtlqxvl+N1c/SJLkVERSTjF+j 8sFId17N1qHrNBgh8TZxnAsnhvL3K9Bl4XXERgjh6cQ4llRfUW/xBJ3xU5cEHl2kyJDQ X6fgfJa0E2RheUG7uq7UBo+pD59Wz9593GQmFQhCBg7wxJboEI5xuZJjsr8mdx2l2aKG hHGw== 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=5F8AuAdD6vIH5WTUv671XyQbSMrH4wURkSBRo5DqQ6I=; b=Vtr4B7TCMlplLdlab3pD2bOZON2UPR8+MX7lDxbOYB/jEIwfwpZPe6ijbrVMax9rz6 Uac97r+R8RpqCFe8SMmw5mZil5slTV1ZUhd0L65elH9oPoqGduonaVDaGTWwIA/cL/u+ JiMV6CHIU1gSSJj7W46T+/aLmRrEoLpmwcGwwaKilw+6mI1W/Ww+xjJ7ziSO3aCTC77K t2LwcgAN2cD7RQgwrXjOCZs0NLpB5l9L7WkoUv2ga5FNMxfXokWaLiRMzGAyoKxAtLCM ziEjkAuDnZ5quAJiSJ+N8nyDbH48ll0LNC7oMVdtY8ge0KNhvsxX2YbcHkg8VbwGfBb0 1Q2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VCMH9aJZ; 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 w8si1516806eji.466.2020.05.27.03.03.22; Wed, 27 May 2020 03:03:45 -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=VCMH9aJZ; 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 S1728492AbgE0G0q (ORCPT + 99 others); Wed, 27 May 2020 02:26:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728003AbgE0G0p (ORCPT ); Wed, 27 May 2020 02:26:45 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96FA3C061A0F for ; Tue, 26 May 2020 23:26:45 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id e11so10437229pfn.3 for ; Tue, 26 May 2020 23:26:45 -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=5F8AuAdD6vIH5WTUv671XyQbSMrH4wURkSBRo5DqQ6I=; b=VCMH9aJZEMUKwdWpD907O6d8TMaPjL4JJT4vpgHMwChl2TQh+0cIkUtMSXgS2ZH6aN bvMDRnH156mxfIHNj/zo6p7qGmmMeqaaUhEVvaFikc4qGaCK1koc7PLRxw5tNNHdY2Mb jtIwF/7tRuPFWH5QwPRZ7KyTU+s9nBN9h2e0GSy3ObZyqPkqHNmMHICCJQ42Jlcj9xLI 8lgYj2RjFBgVwqk7nyzvyNNZb8S8eNqrKSf52wkkVDL0c+AlKll1IyK77BFOPAYYWyTC YgMZz2JkmOl42xHfxOV7PDWHf9Elfa3KofSAP08d2xpMV9jDgUlNFwAn4bjEc3bcOEhO cFsw== 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=5F8AuAdD6vIH5WTUv671XyQbSMrH4wURkSBRo5DqQ6I=; b=LfJ0X/VGMVrRrBmEaw26j9tf9U3D0OTZbYJpWJZXzPSrgsoERxlmon3Ir+GDaPbve4 wihcsbv0oL4im1GO5l+J8E+3XyyiWsLdGavSQqncSe3fwN5N9/xzieUQLjxjQ6S2+rQE NOokeJfWKP2YyWpi3gBfAux9oDtz7U1JaOEsr+pkZQ62TYWlqobr2tMIDsygJ/f/Hnsb ts6csNj7PyRK9FR0FExW0DcMeKYAFsqAn3kToGAsJfNysHRIjj6M2RdoNutY10cOZKTZ CFCmHY/kWUQ1ZUvSWcD2L60DVLiLqOFQSJuw+kUgLVC2TN1RJUxRFGxZN2Lcwj2EE9PQ EjUA== X-Gm-Message-State: AOAM531M3XbZSEPH8eoABuNum7IzoH3qFooEZSWUX/p4K7+v32SlEdBv VDD8EZDEvMUKhU/5CpYhPbPHsg== X-Received: by 2002:a63:689:: with SMTP id 131mr2278235pgg.401.1590560805099; Tue, 26 May 2020 23:26:45 -0700 (PDT) Received: from localhost.localdomain ([117.252.68.136]) by smtp.gmail.com with ESMTPSA id m12sm1239121pjs.41.2020.05.26.23.26.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2020 23:26:44 -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, linux-kernel@vger.kernel.org, Sumit Garg Subject: [PATCH v3 2/4] kdb: Check status of console prior to invoking handlers Date: Wed, 27 May 2020 11:55:57 +0530 Message-Id: <1590560759-21453-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590560759-21453-1-git-send-email-sumit.garg@linaro.org> References: <1590560759-21453-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 --- 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 f6b4d47..349dfcc 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, dbg_io_ops->write_char); for_each_console(c) { + if (!(c->flags & CON_ENABLED)) + continue; c->write(c, msg, msg_len); touch_nmi_watchdog(); } -- 2.7.4