usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler

commit 6d8fc203b2 upstream.

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: c7260e29dd ("usb: typec: tipd: Add short-circuit for no irqs")
Fixes: 45188f27b3 ("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>
This commit is contained in:
Sven Peter 2022-11-02 17:15:42 +01:00 committed by Greg Kroah-Hartman
parent 0077ba996b
commit 70551a29cc

View file

@ -474,7 +474,7 @@ static void tps6598x_handle_plug_event(struct tps6598x *tps, u32 status)
static irqreturn_t cd321x_interrupt(int irq, void *data)
{
struct tps6598x *tps = data;
u64 event;
u64 event = 0;
u32 status;
int ret;
@ -519,8 +519,8 @@ static irqreturn_t cd321x_interrupt(int irq, void *data)
static irqreturn_t tps6598x_interrupt(int irq, void *data)
{
struct tps6598x *tps = data;
u64 event1;
u64 event2;
u64 event1 = 0;
u64 event2 = 0;
u32 status;
int ret;