Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1421211pxj; Sat, 29 May 2021 13:03:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOVL3saAnkoiA6DtyuUsA/tSJuzt3htN9/+Hk57H41j4UhaMl4jFliQfW+ejBQvEL2cWcJ X-Received: by 2002:a92:cdac:: with SMTP id g12mr11619229ild.72.1622318632111; Sat, 29 May 2021 13:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622318632; cv=none; d=google.com; s=arc-20160816; b=PO+0SPaZrTkpHtoxiFC9nZxGnhjoFZ04jiLdidyW+heLrtkhES86pG0KFp4wpQwkp/ 3pJmLfm320fIXfPQ/FaZWDNbxv1keMYtXSsdl2YHeO46+vTaSUGb1P+JXa89dO+o5Kxn n1oy+htKFvd7Ly2eOy92qHIycJMYof8scgEaT2fYhT+4724Hrl6sXHPcNzNrIBSGefzV 5kqZDYZ6WDjS6Jk9WEVIpWdyWCc06h8+puHXhBKTZLdkfrnMlP3mPNYfIqZ93CT0AXkz fGpe/wzri3D6QnhrmV2TbTKgfpmyPvvBMzpNZPn3Kews9JeJlMle4oXBcNbz9gqsL7a8 uIkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4FphgqFErW0u2I7OqG/s+zxrWEtrI/oXO1p258v43Ag=; b=H4sKn3vvEYjfVIuwlmvlwVYxg/TgDQ7twH5NpfypLnjDXdKF8oGumV242sfk9s6/8e oHUi+c0KmdjL+akeUpb3V0OKOAr5bGWVNUDiYa5c1HXVFX+gbyS1BB97n0LYtWwYO0bZ vNuStIVLUfhFWTOi11Z+XngruRStFqQ1m5t5cQe0IYx9xkkM0JZHOVsb01Om3Ag21cRS 5WtPKxW1Y2NWgUcvw0Gi+1BpjPIcNcI040LH2TJtDJjjjCjwrhx7nxhNJOP21ICa4F8j eRkrzYcyt5GpTDtcWQo+dqYZYH01+mpb/DCe5MoCb4WFPwSiuK34B0SfB5nZ6CDgDg7l f4ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n55O3oUL; 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 d8si9252831ilg.2.2021.05.29.13.03.31; Sat, 29 May 2021 13:03:52 -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=n55O3oUL; 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 S229933AbhE2UEQ (ORCPT + 99 others); Sat, 29 May 2021 16:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbhE2UEC (ORCPT ); Sat, 29 May 2021 16:04:02 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BE60C061761 for ; Sat, 29 May 2021 13:02:25 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id 69-20020a9d0a4b0000b02902ed42f141e1so7005089otg.2 for ; Sat, 29 May 2021 13:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4FphgqFErW0u2I7OqG/s+zxrWEtrI/oXO1p258v43Ag=; b=n55O3oUL67115DySLu3bR8N2ipzKbkp5AMEbL2zGQSzsU2SCz9NnacVuqYt0s1Tm2Y kai018ghAOhIUh9fM7QmYEaD0kiyJCq+L6NbXJeO9Lx8uTA4lSkQ3VZA+2w+iuTG0iN5 iXT4lfqH8Vg0luqwzPwaig6BeR7vT2Ro7wNYOnX4SHD/1JzhHtjzKvX1Dy865g1wyTxk 6aVrHCMQ2wJwwOFnRfvNtws8yDIDNcvxJIcyVuPUMTfRjDaCJRU72M2RCkO1huZBKnAj RsGbffTt/dBLg7aLs4RE43cUWeY3aDLDdpXXsz7mGeJ6D2bV0+OPKc5tgAyexCgXBUNJ 7O0Q== 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:mime-version:content-transfer-encoding; bh=4FphgqFErW0u2I7OqG/s+zxrWEtrI/oXO1p258v43Ag=; b=QTgxJ0dk7qct666bJgSmyRoVmqfbvitz68um1K6i+OrFOy+p+8tWLhf/HQklBn5f7d V6b+JYrQXsn9jiPvGArDiw8rpMfbuDwMp9gPVo9HpqfcgaJHl8zAz7D2AqCdeGk3prQ/ v3CDzUPj7XFhepqXiL9CpRhHaoY395F8Ch0MQ2WdhzB+NDPjk+DAkngzRZAreuglRBk6 aKSgB5axCwfsCV0J8YSJC3Qb2lISlaMLTSXuq6iLbTxOnj1x15FjBYOe5SwCeFRS6YOf Ma8UZs+3WcZ6zpTLh3uGNQHM/sRkEwHFcVT3+CA7eAd93H5rUuBCdGtVABMV4kXRtMT3 wvUg== X-Gm-Message-State: AOAM532gBmDFgQ8M+FNmxTyTkoz0FyoT9CeDcwdzNopCIOkvl83//Q7Q 2gZkDjurSS2x8DwZqdN5gjEKFrdRtYnNdA== X-Received: by 2002:a9d:8c2:: with SMTP id 60mr12168888otf.217.1622318544504; Sat, 29 May 2021 13:02:24 -0700 (PDT) Received: from frodo.. (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id t39sm1868064ooi.42.2021.05.29.13.02.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 May 2021 13:02:24 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH v6 11/34] dyndbg: accept null site in dynamic_emit_prefix Date: Sat, 29 May 2021 14:00:06 -0600 Message-Id: <20210529200029.205306-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210529200029.205306-1-jim.cromie@gmail.com> References: <20210529200029.205306-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2 prints use site->member, protect them with if site. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index b2fd7c181bd5..868f56edf831 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -630,15 +630,19 @@ static char *__dynamic_emit_prefix(const struct _ddebug *dp, char *buf) task_pid_vnr(current)); } pos_after_tid = pos; - if (dp->flags & _DPRINTK_FLAGS_INCL_MODNAME) - pos += snprintf(buf + pos, remaining(pos), "%s:", - desc->modname); - if (dp->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) - pos += snprintf(buf + pos, remaining(pos), "%s:", - desc->function); + + if (desc) { + if (dp->flags & _DPRINTK_FLAGS_INCL_MODNAME) + pos += snprintf(buf + pos, remaining(pos), "%s:", + desc->modname); + if (dp->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) + pos += snprintf(buf + pos, remaining(pos), "%s:", + desc->function); + } if (dp->flags & _DPRINTK_FLAGS_INCL_LINENO) pos += snprintf(buf + pos, remaining(pos), "%d:", dp->lineno); + if (pos - pos_after_tid) pos += snprintf(buf + pos, remaining(pos), " "); if (pos >= PREFIX_SIZE) -- 2.31.1