From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B8C346AF39; Tue, 14 Jul 2026 13:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784036852; cv=none; b=NLjb2fS0YqFqC0S+7w1IAzWjmv1HIouaDzKQH5PaJIqcy2ERR3Ur4KdTTZ8KWtfvvfHYzh106HtFrqGpw129Imj4j0o+QFpYO3TtexG1I+TFaewJVNfudLDGf3iA+YSJLvD3737zqr3aNS4YVC3P2EiGNJxs+Zt+fQSneukZXE0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784036852; c=relaxed/simple; bh=v2o9z94asl5iQQQd3utUGGpD+9CMIxAw45QWSytUF3k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cxpiQ3DPc7fEYHEk1Pc7jDIz6WOqd1GbC9v6AIUYbplC7VFYSMHHRpfk8UGuSSfUM6igmOVnyQqU4hxmVWqBnYyggHlki1w2yUJSaTi1Ym5gBcec/jbAIBwemkTJB5xSj9UZClHpOnDcFl/omg5PsKyppn4BCuF395kdOtXKpxk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=l8UnPiJm; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="l8UnPiJm" Received: from localhost (unknown [95.24.32.156]) by mail.ispras.ru (Postfix) with ESMTPSA id A899C4077925; Tue, 14 Jul 2026 13:47:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru A899C4077925 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1784036844; bh=EAzOUwTIZxPLoFmQvs7pqHvvpdS36xjaII/OElsZQJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l8UnPiJm9VfrOQV7wfrQYwiEBmuR836LAvT11z4ZCE+IWhIhMHPbUFtbgqeYyfxiX X11uwK8UEW99zwsvmOsgUsBDtM2axL/d3RM8bG7+r8tJbI4ErXg1L9a5EYFnQamxRP vcRYGzrkWbNr/aCBVYMBEPrORdh3+wxN5hNHWfTM= Date: Tue, 14 Jul 2026 16:47:24 +0300 From: Fedor Pchelkin To: "Alexey V. Vissarionov" , Vasiliy Kovalev Cc: Bryan O'Donoghue , Heikki Krogerus , lvc-project@linuxtesting.org, Casey Connolly , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Guenter Roeck Subject: Re: [PATCH v1] usb: typec: tcpm: qcom: initialize currsrc explicitly Message-ID: References: <20260713182500.GB22956@altlinux.org> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260713182500.GB22956@altlinux.org> On Mon, 13. Jul 21:25, Alexey V. Vissarionov wrote: > When regmap_read() fails, the execution goes to done: label, where > currsrc is passed to rp_sel_to_name() and used as an index after a > proper check. However, to make this situation easier to notice, an > explicit initialization of currsrc with obviously impossible value > is suggested. Alas, we can't simply use zero value here because it > means TYPEC_SRC_RP_SEL_80UA. > > Found by ALT Linux Team (altlinux.org) and Linux Verification Center > (linuxtesting.org) using SVACE. > > Signed-off-by: Alexey V. Vissarionov > --- > drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c > index bf985efe1cd6bea4..d7cb69cf6044841b 100644 > --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c > +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c > @@ -461,8 +461,8 @@ static int qcom_pmic_typec_port_set_cc(struct tcpc_dev *tcpc, > struct pmic_typec *tcpm = tcpc_to_tcpm(tcpc); > struct pmic_typec_port *pmic_typec_port = tcpm->pmic_typec_port; > struct device *dev = pmic_typec_port->dev; > - unsigned int mode, currsrc; > - unsigned int misc; > + unsigned int currsrc = 0xFF; /* error, easy to notice in the log */ > + unsigned int mode, misc; > unsigned long flags; > int ret; 'mode' and 'misc' should be initialized as well. Though this all was already covered with the patch [1], which got the review two weeks ago. Note that it did initialize currsrc with zero value instead of 0xFF. It's confusing a bit. Maybe [1] should be respinned now with currsrc = 0xFF or whatever? +Cc Vasiliy [1]: https://lore.kernel.org/all/20260630120114.185169-1-kovalev@altlinux.org/