From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 C1716354EC for ; Thu, 19 Oct 2023 19:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bI1IaOYN" Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0DB4CF; Thu, 19 Oct 2023 12:20:20 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6bd96cfb99cso71657b3a.2; Thu, 19 Oct 2023 12:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697743220; x=1698348020; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AeyNKDmA955jN+KZgs+inpu81A+J9sy8jsLFlkqKpzs=; b=bI1IaOYNwUy4W64ovDrR8WFt6Nl9VDa2CCoAnT3egfVRF/VUVCZmPfBVWO+QUdmEi+ Ex3li9eWI/lvUwrTPA47seYbyung37Gom4sHp3xF7Ueqp7KwEOAsVNrC6uaOKP42j2a8 m1INE9x583Zk+eMRPhfztRyyFPj73dCN0AqihYmMgNhGJfZWBhQYHubMsLIZ4Or2Ceci yysXOH/EcAz+eNHu8Q+Op14WsKwD9dXs5M7WgB0S/Nb7qxGWT5dKhyWoZsFydL/D10cY xqcVUUCKsFCrfl4+t7z6LxcTeXRfC251lCwvJcXrSHhx0r6emz54GJY5V8CFGoLmksX9 h/Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697743220; x=1698348020; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AeyNKDmA955jN+KZgs+inpu81A+J9sy8jsLFlkqKpzs=; b=Ync1q4I/I6pfvNmWCXGlOOtABF7zKFmgO5xLhERZ0WwfPhkW0EsuuzmntZ7jIf+Xre osSWPtcaseJARnQKx8kd2AgRuQvJewWTDGLGPt+WUoQVDTxw6Iuy7xOBjyOQchkEKdbf ey13HI8MGV0H/vTiVnwylDz4hV/SwFpeNnizSlrtG0cz3kvDldU1o1KxoDqoZqVX1Hmx HmvWr54xKftpn1XrfWZBodroSomIZMrhDpO8AighVhdcjjnbhtsa22DfxOb9+eeAFvn4 viFJfiq6yQlXxG3I6tK5amNkxiFkAcuIqW/X+Bx8YDzTIjVuUPD9P82aRd1jJR78Tl8D qwZw== X-Gm-Message-State: AOJu0YyU8dIPTNox/VV6VmXPAnyjN+VfZHH8uh0rFjDK7qBpUFKVBEA+ /6dtcO65rYKVjBn+0qusUUI= X-Google-Smtp-Source: AGHT+IFhlfOh/+tg7nt9+VsjFFMdrAMcbrKIPmMw9i4sfhyKEat5Hd6wb9YCwxAydwhF8kkmKiknuQ== X-Received: by 2002:a05:6a00:b43:b0:6b7:cc4b:21d8 with SMTP id p3-20020a056a000b4300b006b7cc4b21d8mr2927304pfo.1.1697743220101; Thu, 19 Oct 2023 12:20:20 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:c4c4:bbd9:2220:727f]) by smtp.gmail.com with ESMTPSA id b6-20020a639306000000b0059d6f5196fasm106836pge.78.2023.10.19.12.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 12:20:19 -0700 (PDT) Date: Thu, 19 Oct 2023 12:20:16 -0700 From: Dmitry Torokhov To: Andy Shevchenko Cc: Bartosz Golaszewski , Linus Walleij , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Mika Westerberg , Bartosz Golaszewski , Hans de Goede , Ferry Toth Subject: Re: [PATCH v1 1/3] gpiolib: acpi: Add missing memset(0) to acpi_get_gpiod_from_data() Message-ID: References: <20231019173457.2445119-1-andriy.shevchenko@linux.intel.com> <20231019173457.2445119-2-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231019173457.2445119-2-andriy.shevchenko@linux.intel.com> 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 data-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. > --- > 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(struct fwnode_handle *fwnode, > if (!propname) > return ERR_PTR(-EINVAL); > > + memset(&lookup, 0, sizeof(lookup)); > lookup.index = index; > > ret = acpi_gpio_property_lookup(fwnode, propname, index, &lookup); > -- > 2.40.0.1.gaa8946217a0b > Thanks. -- Dmitry