Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d627887 authored by Vitor Soares's avatar Vitor Soares Committed by Alok Chauhan
Browse files

i3c: Fix the verification of random PID



The validation of random PID should be done by checking the
boardinfo->pid instead of info.pid which is empty.

Doing the change the info struture declaration is no longer necessary.

Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
Change-Id: I55bb08181b316db9bc3801de1b592a2eaa29f3b7
Signed-off-by: default avatarVitor Soares <vitor.soares@synopsys.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: <stable@vger.kernel.org>
Git-commit: 9752c37cc89f43675e70cf9acff23519fa84b48c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent ca4c8252
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1980,7 +1980,6 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master,
{
	struct i3c_dev_boardinfo *boardinfo;
	struct device *dev = &master->dev;
	struct i3c_device_info info = { };
	enum i3c_addr_slot_status addrstatus;
	u32 init_dyn_addr = 0;

@@ -2012,8 +2011,8 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master,

	boardinfo->pid = ((u64)reg[1] << 32) | reg[2];

	if ((info.pid & GENMASK_ULL(63, 48)) ||
	    I3C_PID_RND_LOWER_32BITS(info.pid))
	if ((boardinfo->pid & GENMASK_ULL(63, 48)) ||
	    I3C_PID_RND_LOWER_32BITS(boardinfo->pid))
		return -EINVAL;

	boardinfo->init_dyn_addr = init_dyn_addr;