From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from honk.sigxcpu.org (honk.sigxcpu.org [24.134.29.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC665A31 for ; Thu, 3 Nov 2022 08:26:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id C93CDFB03; Thu, 3 Nov 2022 09:19:46 +0100 (CET) Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kSYW95dxwuxO; Thu, 3 Nov 2022 09:19:45 +0100 (CET) Date: Thu, 3 Nov 2022 09:19:41 +0100 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Sven Peter Cc: Heikki Krogerus , Greg Kroah-Hartman , Hector Martin , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev Subject: Re: [PATCH] usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler Message-ID: References: <20221102161542.30669-1-sven@svenpeter.dev> Precedence: bulk X-Mailing-List: asahi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221102161542.30669-1-sven@svenpeter.dev> Hi, On Wed, Nov 02, 2022 at 05:15:42PM +0100, Sven Peter wrote: > 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: c7260e29dd20 ("usb: typec: tipd: Add short-circuit for no irqs") > Fixes: 45188f27b3d0 ("usb: typec: tipd: Add support for Apple CD321X") > Signed-off-by: Sven Peter > --- > drivers/usb/typec/tipd/core.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > index b637e8b378b3..2a77bab948f5 100644 > --- a/drivers/usb/typec/tipd/core.c > +++ b/drivers/usb/typec/tipd/core.c > @@ -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; Reviewed-by: Guido Günther Cheers, -- Guido