Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2620449lqp; Mon, 25 Mar 2024 04:49:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmQq+cmNjRzUaPkUDgK+ztmzDpPZo/ucS5gMKMAKN17oaLdN+gyJUb6yx45cQ/C5q0iydsVILVBjXTmUJtb/hoWoNCxoo4p0fpRrwhsw== X-Google-Smtp-Source: AGHT+IEwsbdCyUB3+NuNNdK0zYbGnQm//mz8QmrBd9JZc3LRL7nNnaL+8u3G5MpoRgxCKtKS9cs0 X-Received: by 2002:a5b:151:0:b0:dc7:4546:d107 with SMTP id c17-20020a5b0151000000b00dc74546d107mr4652561ybp.23.1711367370926; Mon, 25 Mar 2024 04:49:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711367370; cv=pass; d=google.com; s=arc-20160816; b=0EolRPtDsbvbK7r0dLZHaoobmkGLd7BAXA57mcf4NviGJPBI2nA/eHw86afN93gJ5R yEY5fshcYmNEkx3G/2ALRZ4IjI7PBiNs+wejR7+c2/dgfcL4mzs52jQGzUHtN190eW/F 2TZ0ioIKgWZQIhyjiHWRbV6PVvhKKg2o7zHXyc8UrX5R6AmuQ/PMLhCV92r79KVXsujB IGeaJCxVWUYn7AOG252GziTIDwTOWU0tjOKgR8qZyiGNMQdr6agIhOq1GLr17jdirzLY B36h3c/ci37FRTaDpJEnjAQ9fYdkfNWr2vq9nU08kReYcTmOssu8n1RlczIkWYafAurY Yu4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9xbC9T1hPEW+G0Isii2Uk67hIgYCJlzEjSeMj91qBqw=; fh=ijbpnWYVbrBDvLDSG+ZeUdzKsrwT4UULIjxtWEKt1Qw=; b=Vo2glq9fhfhABC1x35ofHi0nR6V5Sj4btCGrRbgljTOZweWEKrtVoM0frsRj4UMjtv YwajnYt5iNchUcAEHwALSX2BtoXww82iGFfFSAqWrTwNGzQFPE3ZC461HV9dsbW12Ri/ TfTEmBxXdaIo6JRNsZqiS+LcGt844D7RGSKR3R8cMb+QYR01t+9a1v1xSief/ANCYFrV unYjhLBX/RSgWSDNx3uxBEYMFJZfTEJaL+AQdKcvrHutIWu+h8NEg9FU9TiuQ2rZXbt2 QYgeEF236hvdqnwmsi7ahVXbmbXebTf7WYhR5LTJdFQNsHlc3nrOGC+mfKzk+HDkCc13 k9Hw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZXsab4lX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 14-20020a0562140dce00b006968727785esi2978417qvt.105.2024.03.25.04.49.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 04:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZXsab4lX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2CC2F1C353FA for ; Mon, 25 Mar 2024 11:49:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 337C63C0D70; Mon, 25 Mar 2024 03:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZXsab4lX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F6AC131BBD; Sun, 24 Mar 2024 23:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323860; cv=none; b=RVr5AiU1Eq1WrDgzCPcJpj/3MbtIgvWmH3LOKlZ4BYovkAkCXSuSPyqamcisv5/QfRcI1kF5rlNxtpbqRMWgKU6onUcdghw4T6LRm/eNitx2RD+hZBM/vXtkFOTIIId1JdtoXJGTBSnRQfMinCb6DaN+5Pi/4fJ0/q87h6rd5RE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323860; c=relaxed/simple; bh=5VQaZ7OnaaW+qUx+jzwOvmGzQYVd+zAXX4Becu7Jxdw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b6dgKRN2HYIXYM4FgR/8CRiHQqpgOzmQkpCt+6fTqHmztHTWqQygeQIL3DIUaCpEzRPV1VGvk3QDzoE90Ohta50hSznCvyCcdpaVCERoOyrvZjmIcL/q3sJ8iUsmyR8kOZREnHrXL6nEAmAZCBTz+TWpXbICgSTcaIQMx3mfksU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZXsab4lX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B72CC43330; Sun, 24 Mar 2024 23:44:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323859; bh=5VQaZ7OnaaW+qUx+jzwOvmGzQYVd+zAXX4Becu7Jxdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZXsab4lXZad0IX3gC+1oZcneakmm3zbZHfE9MqqaQokh+LvG0wcGCxQhZj/Es1u0P z/g53cD1YHcSyvRGK0RsrHFliPVyeysixnKC5DYgYFgaHP9fIczRR063tVvk3P0kik nZRZSA46ooJUfYdFYHzqX6l0erKvLwCpwcEFlOCuvIW/5Tgs17VdhfnQSFsrco4IPK J0rP+wspa8WlF++vOThwEgVWIRiMWn2WCJzfbyLW6jeshTM0cDSeCCIAjfPzBVBlLA GC3rHfH+B7u4qowv175Aeq4D4xdt5e1ROViAqrgnWioyX9vc2hbXUZ7FvqPYQO2Mav ijv1TTvxYn6mw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Marek Vasut , kernel test robot , Dan Carpenter , Mark Brown , Sasha Levin Subject: [PATCH 5.10 237/238] regmap: Add missing map->bus check Date: Sun, 24 Mar 2024 19:40:25 -0400 Message-ID: <20240324234027.1354210-238-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Marek Vasut [ Upstream commit 5c422f0b970d287efa864b8390a02face404db5d ] The map->bus can be NULL here, add the missing NULL pointer check. Fixes: d77e745613680 ("regmap: Add bulk read/write callbacks into regmap_config") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Marek Vasut Cc: Dan Carpenter Cc: Mark Brown To: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20220509003035.225272-1-marex@denx.de Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/base/regmap/regmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 2dfd6aa600450..a3c4086603a60 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1796,7 +1796,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg, map->format.reg_bytes + map->format.pad_bytes + val_len); - else if (map->bus->gather_write) + else if (map->bus && map->bus->gather_write) ret = map->bus->gather_write(map->bus_context, map->work_buf, map->format.reg_bytes + map->format.pad_bytes, -- 2.43.0