Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp891496rdb; Fri, 20 Oct 2023 02:26:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqYQUpUt4DfnzodM3aA+wSAblFHG6es8refrDyqpql6oBdWZaHX6UGA4DXvOfkd9co6vm7 X-Received: by 2002:a05:6e02:4cf:b0:351:4dcd:7655 with SMTP id f15-20020a056e0204cf00b003514dcd7655mr1296120ils.31.1697794014903; Fri, 20 Oct 2023 02:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697794014; cv=none; d=google.com; s=arc-20160816; b=RuphNcqUxg+TZyA+iD67TysbxD2jwJj1yCXPSGM90CE9kRtaHdeNipbkTnRlb8cd1Q u9/6VbNNMgN0Eyvb4GMCyZZNNpqlXiOriv5lxnoX6YdVMPx35IXtaE0wVMX8AcvO3wOY 6PiKUGNmvQSELw5GdE6oPtUyLgeHSDW8hU7hfI/f8zpMjSuZb2+fzgs2eGR5bCNkI7yA 2PkWv8zADqoVXRwFj8MXpPBiWjdfYCExP8QNfSnkoer29BIcd5OLZhxBq9I2lMYFReza W1zm6V327oXLcwEWkvutzF3Hz7Rb0K946dVeu90u53R3JGBdvAth5d9GmYdNdWm0Xi05 6iXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=g3n+mlq2jHg9E8YngtT6r3A6TvxLTC271t27uMu4pVM=; fh=LpS4XkbBNvbFVFfWMa3fRg8AIO3tCp3V72qSV2T8E6Y=; b=lEOGMhd3pEUS1Rjn09B6lWPnusLmUvgp76h1Ahfeil1jpUaqNRhEPYJuVC1LCAgfB/ +rSDxMeySqRpBFFxfuTv1CwnnDKOpcTxQWbP+hv4lXUdprGsn+bwiXerfb6FoUPtCqBZ hSAYEgcJMueAApoYJhOJBpqfzYkfCh0cp5YhTPinyfZAQzvozgvzDkW/ybDgjK28sAUT zX9WiEXtIbzu8jsQFXi3mvWL3Ej/GRfq80uMJYy8rwH+sUV1XvWSmBoOzFy3KipAK27w hpgYPF4nVFSnRAy8gLSfKmG9XtNpTwavtJUxsKF7t/w1YwvyY3U8Y+RQZ/Fziy8lKVWC EKFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=KF328bIS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id i191-20020a6387c8000000b0056a1ed17deasi1468646pge.675.2023.10.20.02.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:26:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=KF328bIS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A261A829F66C; Fri, 20 Oct 2023 02:26:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376807AbjJTJ0e (ORCPT + 99 others); Fri, 20 Oct 2023 05:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376759AbjJTJ0S (ORCPT ); Fri, 20 Oct 2023 05:26:18 -0400 Received: from mail-vs1-xe2b.google.com (mail-vs1-xe2b.google.com [IPv6:2607:f8b0:4864:20::e2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4529919BC for ; Fri, 20 Oct 2023 02:25:51 -0700 (PDT) Received: by mail-vs1-xe2b.google.com with SMTP id ada2fe7eead31-457c057bdb5so244396137.0 for ; Fri, 20 Oct 2023 02:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1697793950; x=1698398750; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=g3n+mlq2jHg9E8YngtT6r3A6TvxLTC271t27uMu4pVM=; b=KF328bISD+4M1PB2z/MYZMag637w/BRFhy3SddegTCZdoDgOAD+rY0LnugvHoUD5eI ZpFLlwqpwaXiG/xDVkYXhPH4pDbGG9jqKGCU1v1um3vxX/t5GPmC/7mzA7NFge7pLG0V rpbDkVG7k2CfW2OJ7lUByWUokEyr/zoBiR8fEpbO68jcp4Vr4K95TXi1GB1TZhbgYGCY GKp6hhH80sHfeqjpY5BD75zobu3ucSHGInQwhYnetc5exR9I8G6NPlUIrDu1sXsF9Zw2 PInbb54lw87LkO0K7ro3qUXxAgxEPiEFlCFcUWqCcg/11MPUrb+fHsQVtGSna8h2k9pC cidw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697793950; x=1698398750; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g3n+mlq2jHg9E8YngtT6r3A6TvxLTC271t27uMu4pVM=; b=IOgu+r28fQJTPpr5k6UeNzwK6hn1JxpmrAaeUSd1tn2NpkRQwqoIft224O2jZ5uG9l LKdPt416KNmtDDDSAlEYyujJpkXaWTqadYEKC2RA8laYP6osCUFMMaD7SA8pivvG6dtR PS71qorPi4Jm9TqHbZCXN6VlQEjbAbWg5jl4xG37EZfSIuN0Piy2e48znac9S2sMsjp8 DPrbpbEQfpO71RaV/J0ZFlys5tJi795UQhGTJcus/TBiOg8ffOBMfvO5ue6vzTARHNmO Lw/Vh0DBBZI3iuZw8Nu/+0fK+HyyPLtwbF/OgJEadPjk858omocrVUD/OQpjPbyvf7LN MvrQ== X-Gm-Message-State: AOJu0YynTqHsLegVUk04yxLcr7qJTou065b0uqYPxqMPqQPxINwf3p3s BfNaAU+VBFJ6vNGom5SRP/ybr/kzD8rbOZRIVa3b0A== X-Received: by 2002:a67:c00e:0:b0:457:bc94:fc9f with SMTP id v14-20020a67c00e000000b00457bc94fc9fmr1330423vsi.13.1697793950031; Fri, 20 Oct 2023 02:25:50 -0700 (PDT) MIME-Version: 1.0 References: <20231019173457.2445119-1-andriy.shevchenko@linux.intel.com> <20231019173457.2445119-2-andriy.shevchenko@linux.intel.com> In-Reply-To: From: Bartosz Golaszewski Date: Fri, 20 Oct 2023 11:25:39 +0200 Message-ID: Subject: Re: [PATCH v1 1/3] gpiolib: acpi: Add missing memset(0) to acpi_get_gpiod_from_data() To: Dmitry Torokhov Cc: Andy Shevchenko , Bartosz Golaszewski , Linus Walleij , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Mika Westerberg , Hans de Goede , Ferry Toth Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 20 Oct 2023 02:26:48 -0700 (PDT) On Thu, Oct 19, 2023 at 9:20=E2=80=AFPM Dmitry Torokhov wrote: > > On Thu, Oct 19, 2023 at 08:34:55PM +0300, Andy Shevchenko wrote: > > When refactoring the acpi_get_gpiod_from_data() the change missed > > cleaning up the variable on stack. Add missing memset(). > > > > Reported-by: Ferry Toth > > Fixes: 16ba046e86e9 ("gpiolib: acpi: teach acpi_find_gpio() to handle d= ata-only nodes") > > Signed-off-by: Andy Shevchenko > > Reviewed-by: Dmitry Torokhov > > Although I think it would be better to change > acpi_gpio_resource_lookup() to take an index and return a gpiod > descriptor and have a local copy of the lookup structure. > I queued it for fixes as this is a bug, we can improve it later. Bart > > --- > > drivers/gpio/gpiolib-acpi.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c > > index fbda452fb4d6..51e41676de0b 100644 > > --- a/drivers/gpio/gpiolib-acpi.c > > +++ b/drivers/gpio/gpiolib-acpi.c > > @@ -951,6 +951,7 @@ static struct gpio_desc *acpi_get_gpiod_from_data(s= truct fwnode_handle *fwnode, > > if (!propname) > > return ERR_PTR(-EINVAL); > > > > + memset(&lookup, 0, sizeof(lookup)); > > lookup.index =3D index; > > > > ret =3D acpi_gpio_property_lookup(fwnode, propname, index, &looku= p); > > -- > > 2.40.0.1.gaa8946217a0b > > > > Thanks. > > -- > Dmitry