Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp102458pxf; Tue, 16 Mar 2021 23:56:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBmeDlII6A+tfAT2BFdM1sxo+6wPjB0r5z8wt/TXuWwXsYZRRjFvqzNKz9EYTZma7HGQSh X-Received: by 2002:a17:906:4705:: with SMTP id y5mr34118838ejq.119.1615964196355; Tue, 16 Mar 2021 23:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615964196; cv=none; d=google.com; s=arc-20160816; b=nNW2NVLF7TQiCCpSmC+JEKeCZ498s9cm48SLg1dyQj0iIXsaK02CYiimbOJrP6ayXR /hYxXLaQR5r/8m/DULvAEWQ3renraqkXiVU7eohD4LOwM3fD/Vqmqxgv5tNM2FCjuUA7 vcuNd+34dxsyq0Qw1tOMgKpP6GAY0xRGMh4VNf2YLO4ZWEhFTZ6NPtV+tezDv7sUIW1l CgrI8TMRiMHFr5YOKjgh4hlkqlgmLf/RrN7TJ6KEvDaCX7tBRO1v78SBGb7r22JCU1AO 9IR5c7DdFKb5dxkpyJbPiY0J/WZIxgueIbrom33umEu2MenE8s7cPxgnagGIS5CjDwYe fgMA== 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=nbEO5J6TrCUtPHJZSZY2F/E+EXeJvx/lKUsjdm8XGmk=; b=i3oso5Pwl4TNFdwLe2fkJ2l5cLYvfjERah5hI35TGCqpd0JRn5WMlRjdewlYF1DY2F BcxF4MCO395ENuyFxE1Ay12Rag7yhWzpA/Aq8krhWo+OatN8fSfxtBNbU2V7NJz85iE+ BWEF7JfLeQLIQomwIl7ZH6tE78qLrCJgYk6eZ6Vp4A8hFbOMWszDY5d53qwCZb6AXd4k tXv8aU32WWFtiroE5u7+tNPNWNKVAQqCLhGkJYA0pJESg7XvTROwQrv3oXvDW0NhgxGl pFj7ZDTM+v6tqggWa3GItyZ9tc4O+o+fizybL5E4Mhx3NAMpiC3Zp9AGlkDOogbJ67HK mhRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TPAwgTCg; 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 cf5si15688368ejb.346.2021.03.16.23.56.14; Tue, 16 Mar 2021 23:56:36 -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=TPAwgTCg; 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 S231285AbhCQGzF (ORCPT + 99 others); Wed, 17 Mar 2021 02:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230224AbhCQGy2 (ORCPT ); Wed, 17 Mar 2021 02:54:28 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0504DC061760 for ; Tue, 16 Mar 2021 23:54:28 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id m6so506491ilh.6 for ; Tue, 16 Mar 2021 23:54:27 -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=nbEO5J6TrCUtPHJZSZY2F/E+EXeJvx/lKUsjdm8XGmk=; b=TPAwgTCgMMwLMUEXeE5h9XFisbZbbme5nv8AMTdPR2mI9cdlT3bXEH2Ygip//DyaRp aMuQWUF2jLtkUfcNRoWNk3cTq7HR4HRHB57bXMc7biRWg5aNLbLTfD/nThrE2L0OLk+a e9Q/l+pvAJKjkh1k/I/gxiy4b4bDay7n5t0pgm2zh/8P9zZb1JVESPcgniGZrRu4YgwB 8T9mBwaxbom5gKY3gI+nx/K01mrl3QuGKbteDx6dnt32Xt+qG/RdI5zwQ4ai3dWeKT3+ GIT6uJqCXc4N5MizjnIHqAKUO8U3BKwLSpVFx54tgxswizF37TTPYZJ7qAhF45zcfU5G fgWA== 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=nbEO5J6TrCUtPHJZSZY2F/E+EXeJvx/lKUsjdm8XGmk=; b=OCkuPuxVcQQDgqC+pHGj3cfnwneHjsAXF+BjIVTVjuqAxzEKX5Ftr8b6k0OQagC7VI avtwCq/maozI5qODmmx2sH6RqCPoH1nZ6pJWI5v3YTpf7yAsxzpataoPk2Y+mOC/1UOL hEDZM4asrevD9amxjRiamL9IdqaULKjoLLsnm4HBWAD07fqzpTGu2Ngh+0fOKfaX/5yf vdc7gI/VHPOgnd1vHPRvBY0Xs+xNr5cH4mDT9DVSXlfiR1R0se7EPGx+2+Rvtqg/+Gsb iWmEvNVqfbocS9sk68gz2tBpuVON9WP5TNxMEi3SrIMWYN5g4MpLMC2wG42A1cihSfsX pfNQ== X-Gm-Message-State: AOAM531FPJMnCjBHDTDj/0AFBU7UO1JmgwHZ5G5frrDML3kxpYQfCs62 kGW6Ict1ggEOv9nrHfIqfn4= X-Received: by 2002:a92:740c:: with SMTP id p12mr6751232ilc.9.1615964067467; Tue, 16 Mar 2021 23:54:27 -0700 (PDT) Received: from frodo.mearth (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id w13sm10583057ilg.48.2021.03.16.23.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 23:54:27 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH v4 07/19] dyndbg: accept null site in dynamic_emit_prefix Date: Wed, 17 Mar 2021 00:54:00 -0600 Message-Id: <20210317065412.2890414-8-jim.cromie@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210317065412.2890414-1-jim.cromie@gmail.com> References: <20210317065412.2890414-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 151e55ab6bb5..0c535f3c2ba9 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -631,15 +631,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.29.2