Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp742814rwe; Thu, 1 Sep 2022 07:05:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR6BZ08FIIRzpXAaELemA3ZEEJLo7OVt3CCq++1mDsQCJttR40Mzpx500bv+JTn9yzWEjqea X-Received: by 2002:a17:902:9a44:b0:171:3541:2c75 with SMTP id x4-20020a1709029a4400b0017135412c75mr30180533plv.15.1662041127268; Thu, 01 Sep 2022 07:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662041127; cv=none; d=google.com; s=arc-20160816; b=LKZZOaOafOD5bpL8DmPc+0tXOCSbkOp1VpLfR8G8hOqFuf+oPN40qbdj40fNypA6LJ WaIHFqimwoD46BE4GHF37ekRSqVTeAnm+2h4cEeaX16kq2CixjHReLYXBeOJVnvkndJi N5Mb9c77dzdpwoLOzMBrmPV8slcXABKzrgG8snI2AVq/QJVZNNX9VzVvTUOAjwCrCi+v HNOKO3DYPJRw/LSXudrkktzN5LcEce0MoPg20AZCWazFfwZvK50KXFCy084b2tP3/r+X 0trZ4HNnDKPbZ4RtuqQkx5x34BX+XByt+YDpZpu4kD1CMP6QXednW8mZR6c2Cc7Nkfm/ ODgQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=3oZ//ivVZr1VbcE2kftPBohzKmjeorZ6yDdy/3kQLJY=; b=bkz430fowp3Dc6x+Bu4o5qtJREorSs5hRBYlemGIOLcQ7JxW9ttH6xBYshfq9OUH0F ljkB3TO2Si5hwLt/syaLJ0d27ojl/4veJ966V8XP+0SfCwZbAdq/okS9hDnCUyYvXo1O ii+RQCLTsusba87iJOru+Efrl6SwXkptAmMzFubMk79WiQ9eZcJtMf+Yfyqt51//7i3d dsY002IVZ7EIF/Tw3xZTvHBietvwO3usJM1IkAWHksHjlQGwMS8BgZ91iH60O50Shkt+ 3oI/l8GXxteQSZZjKOMLo/+iqAkvDJuMNjcfH46S9WAN7G+TyzIwweXfe8J9OdYGfWzj S6PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RFiTqGAj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p22-20020a170902a41600b0016d47244b85si16226247plq.327.2022.09.01.07.05.12; Thu, 01 Sep 2022 07:05:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RFiTqGAj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233606AbiIANXq (ORCPT + 99 others); Thu, 1 Sep 2022 09:23:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232539AbiIANX1 (ORCPT ); Thu, 1 Sep 2022 09:23:27 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 993C03B7 for ; Thu, 1 Sep 2022 06:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662038605; x=1693574605; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Uf4uabdWV4txRLk2bqOo6gQ1Ue/HvWqnSFldAB4rgj0=; b=RFiTqGAjzQariw3b+H0eHYF4n70Wn6+XolmoWU8erdFNm96Me/QZb3cx KYW5UUx2lyZJMHXdjsd/yQ6MZpF8dOnohvU17pMPNsKJhsCxFJzP921Mh AoLZqJLSIgz2t3amgf6KezZfJt995Pjr4/3n6zhyzknh+n3dYzqBaGPaU qMiRv+xuyiRMurc3wuZiOTo2GpwGU8fAdR4ikQmBR925ihpSYuxCyV6Bd 1h1ML1lMr2fe+E+kW2VcNKj8Javvhvi6yITJVxp35ddLMDMiWaIsYTPKU nyYPTFVJS3DccgRR/oEDeBFMyRJ8hT+WzlsbknYzAyMOZF9CuUt/07ULk Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="276113223" X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="276113223" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 06:23:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="612489901" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 01 Sep 2022 06:23:23 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 67840238; Thu, 1 Sep 2022 16:23:38 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Dmitry Rokosov , linux-kernel@vger.kernel.org Cc: Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH v1 1/3] regmap: trace: Remove useless check for NULL for bulk ops Date: Thu, 1 Sep 2022 16:23:34 +0300 Message-Id: <20220901132336.33234-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the buffer pointer is NULL we already are in troubles since regmap bulk API expects caller to provide valid parameters, it dereferences that without any checks before we call for traces. Moreover, the current code will print garbage in the case of buffer is NULL and length is not 0. Signed-off-by: Andy Shevchenko --- drivers/base/regmap/trace.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/base/regmap/trace.h b/drivers/base/regmap/trace.h index 04329ba68ec5..e92edc4f4ca5 100644 --- a/drivers/base/regmap/trace.h +++ b/drivers/base/regmap/trace.h @@ -82,8 +82,7 @@ DECLARE_EVENT_CLASS(regmap_bulk, __assign_str(name, regmap_name(map)); __entry->reg = reg; __entry->val_len = val_len; - if (val) - memcpy(__get_dynamic_array(buf), val, val_len); + memcpy(__get_dynamic_array(buf), val, val_len); ), TP_printk("%s reg=%x val=%s", __get_str(name), -- 2.35.1