Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2358580rdb; Mon, 12 Feb 2024 02:02:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPdLNSU43ewoU7NrnHz1ywRmF8fXaxQNCh1vt1GLOk5aYrIgsrUGqYwPmzhJWMCH8yyPCU X-Received: by 2002:a17:906:1389:b0:a3c:51b4:a0d3 with SMTP id f9-20020a170906138900b00a3c51b4a0d3mr3757863ejc.0.1707732138303; Mon, 12 Feb 2024 02:02:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707732138; cv=pass; d=google.com; s=arc-20160816; b=E3dKooci67Q1njd9syB26s4loNIKvMMB72Yq/uByhzK4Dmb3E+NMTDJW6HiEngik6u 98pmubUYHp14SGNt3dKKzXdqTqaloGk+pBbl5lRI7S7voIN5X6wgV2RGu5J+NoEjRQU5 wllAqLrxurN5eGIvVyLGyWyVjtrZ7JBY5yB9rj8qRtPbY7rBvPGWytyjBVQdZ7N+3PLl noOXHVrck20L2vQ/ZVIENrv1L1+g3GmrPtrRQY3urk0nagdoJQp5n+XsMBQ+Ge2j6pfQ MN4id3kNn7i/6weMcyTKQG11ox06JjT9pWEeP7hYBMwZaQD6VbXGxYrYou0xlvLAl9gF 83BQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9+208GsMdT6ArmTsRlnHLBw9gkV85GzOhUcLo6RekXM=; fh=QIuiM3xnSRAr6R7qjti/fcZzYchs+z5Sp33M1augdqw=; b=aN1jmKLMEZ0+NkhCY5fcUCgFj1DQKMTt/oviDlhIL1ul/Qreg8Ci5UuF6xqhhg8uEp VglcoMLeSFSAzLhTX1aGbpra5vPsJ4ol0yALcseIPClpY8wCZqudYWoikQ+1Yor8Txiw 8ZY/BD3cfl9P4b/+PYcgZ3QPrSYOZbCassBN9ojpW/ogcxpuXaZwwmYTXIhqK4J+wKpB QEym7Ny1iSAJ8bYMcIRp8ULYqaYV0Fs/nwtMCjVBidsnIk4qALINFoHzeIE61bCMMD0F nvF56XDsJSk0w+RTXXk5S1WWF2bMI3nZIrw9IEjoSwiMRzeyYHHIh6ixWgvHyKFOwslH 1u2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTnKUsQf; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-61277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org X-Forwarded-Encrypted: i=2; AJvYcCXKLNekBC/mCsToU87VQrxGOt3RN+N5zEwwogCGTWhRwC8xMCgMuCWJCz15/MCvj1bUmvk3k9ZVxDtCbqXjtp9U6ZRZgx8FqriZAQsiAA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hb21-20020a170906b89500b00a3c7740e6f8si29638ejb.1023.2024.02.12.02.02.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:02:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTnKUsQf; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-61277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 644421F21539 for ; Mon, 12 Feb 2024 10:02:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C7D617C60; Mon, 12 Feb 2024 10:02:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RTnKUsQf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B23A828EF for ; Mon, 12 Feb 2024 10:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707732128; cv=none; b=NYQP/UtJR1akljaroNA7bY48DSrbQQjq1wtqSoIbMAVW4p7lGeG0ZGso+7o3+8zQAVgokoujBrDpgUdlVFq4MgvGwwRtS5IBswFOszpHP5ut5OcrXUiclnUY+f7vRDarmOYAVRvxZlOUHe94ONieIDL90t14/umAYMuc2Na5PFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707732128; c=relaxed/simple; bh=zpCv4CyeZaFDF/ZPPOLtiz2KwiCRx5PBxGtNXZYfqSw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OoHsCxWQy3rpWMwzJNFpKVgV6uTedImutDj1yhPV+pAJrptSFluXUZnXLWG/MgBZ1EbvSle3sgOG/YS5flroJ9fAjmEo+13BtP6mbsUmwjVVwvzN9usm08zBOdgDsUf7tm8dZ8D0EzK0io3AZlKDQFBYzAYMS7Pacf32PD3oQqQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RTnKUsQf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC0B6C433C7; Mon, 12 Feb 2024 10:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1707732128; bh=zpCv4CyeZaFDF/ZPPOLtiz2KwiCRx5PBxGtNXZYfqSw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RTnKUsQf+LdZGoaXW8tIy/LD/E1/C2qbraNOSlCF+t6H1Xqb6T+T6W4cJmE/g8hOd 6oSUEUUCgtkcAUqKu6FD8I8cxB3N7xRNnpPG1py2WMCNU5N6Hy29rDqXmMxf5iYJcY wgZntKitw4fsvASCymxTAxCHbpkMTNlUaYvLnfZk= Date: Mon, 12 Feb 2024 11:02:04 +0100 From: Greg Kroah-Hartman To: Sakari Ailus Cc: linux-kernel@vger.kernel.org, Hans de Goede , Tomas Winkler , Wentong Wu , Arnd Bergmann Subject: Re: [PATCH 3/3] mei: vsc: Assign pinfo fields in variable declaration Message-ID: <2024021210-freeway-unblessed-d966@gregkh> References: <20240212094618.344921-1-sakari.ailus@linux.intel.com> <20240212094618.344921-4-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20240212094618.344921-4-sakari.ailus@linux.intel.com> On Mon, Feb 12, 2024 at 11:46:18AM +0200, Sakari Ailus wrote: > Assign all possible fields of pinfo in variable declaration, instead of > just zeroing it there. > > Signed-off-by: Sakari Ailus > --- > drivers/misc/mei/vsc-tp.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c > index 200af14490d7..1eda2860f63b 100644 > --- a/drivers/misc/mei/vsc-tp.c > +++ b/drivers/misc/mei/vsc-tp.c > @@ -447,11 +447,16 @@ static int vsc_tp_match_any(struct acpi_device *adev, void *data) > > static int vsc_tp_probe(struct spi_device *spi) > { > - struct platform_device_info pinfo = { 0 }; > + struct vsc_tp *tp; > + struct platform_device_info pinfo = { > + .name = "intel_vsc", > + .data = &tp, > + .size_data = sizeof(tp), > + .id = PLATFORM_DEVID_NONE, > + }; But now you have potential stack data in the structure for the fields that you aren't assigning here, right? Is that acceptable, or will it leak somewhere? This is why we generally do not do this type of style. So unless you are fixing an issue here, please don't do it. thanks, greg k-h