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

Commit 707a123d authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

usb: typec: wcove: fix uninitialized usbc_irq1 and usbc_irq2



Calls to regmap_read may fail with an -EINVAL return without setting
usbc_irq1 and usbc_irq2.  The error handling clean up expects these
to have been set (or zero on a failure) and currently may try to
clear the wrong IRQs if the uninitalized garbage values in usbc_irq1
or usbc_irq2 are non-zero.  The simplest fix is to ensure these
variables are initialized to zero.

Detected by CoverityScan, CID#1457737 ("Uninitialized scalar variable")

Fixes: 3c4fb9f1 ("usb: typec: wcove: start using tcpm for USB PD support")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a6d5d230
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -441,8 +441,8 @@ static int wcove_read_rx_buffer(struct wcove_typec *wcove, void *msg)
static irqreturn_t wcove_typec_irq(int irq, void *data)
{
	struct wcove_typec *wcove = data;
	unsigned int usbc_irq1;
	unsigned int usbc_irq2;
	unsigned int usbc_irq1 = 0;
	unsigned int usbc_irq2 = 0;
	unsigned int cc1ctrl;
	int ret;