Skip to content

Commit 6d8fc20

Browse files
svenpeter42gregkh
authored andcommitted
usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler
If reading TPS_REG_INT_EVENT1/2 fails in the interrupt handler event1 and event2 may be uninitialized when they are used to determine IRQ_HANDLED vs. IRQ_NONE in the error path. Fixes: c7260e2 ("usb: typec: tipd: Add short-circuit for no irqs") Fixes: 45188f2 ("usb: typec: tipd: Add support for Apple CD321X") Cc: stable <stable@kernel.org> Signed-off-by: Sven Peter <sven@svenpeter.dev> Reviewed-by: Eric Curtin <ecurtin@redhat.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Guido Günther <agx@sigxcpu.org> Link: https://lore.kernel.org/r/20221102161542.30669-1-sven@svenpeter.dev Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 40bf8f1 commit 6d8fc20

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/usb/typec/tipd/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static void tps6598x_handle_plug_event(struct tps6598x *tps, u32 status)
474474
static irqreturn_t cd321x_interrupt(int irq, void *data)
475475
{
476476
struct tps6598x *tps = data;
477-
u64 event;
477+
u64 event = 0;
478478
u32 status;
479479
int ret;
480480

@@ -519,8 +519,8 @@ static irqreturn_t cd321x_interrupt(int irq, void *data)
519519
static irqreturn_t tps6598x_interrupt(int irq, void *data)
520520
{
521521
struct tps6598x *tps = data;
522-
u64 event1;
523-
u64 event2;
522+
u64 event1 = 0;
523+
u64 event2 = 0;
524524
u32 status;
525525
int ret;
526526

0 commit comments

Comments
 (0)