Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2444837rdb; Mon, 12 Feb 2024 05:20:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1PkLvItL1SSrT8piQErFvh1mmggr9LtPcgt7Ey+Q+LzrDVie9OLYkyqAUe6aZCD5cdii4 X-Received: by 2002:a0c:f2ca:0:b0:68c:88fd:d926 with SMTP id c10-20020a0cf2ca000000b0068c88fdd926mr5342772qvm.56.1707744036069; Mon, 12 Feb 2024 05:20:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707744036; cv=pass; d=google.com; s=arc-20160816; b=NK12QKxh0lFMKKlJ3AaSMv1ZKbIykng4bbeJ22/b3jK/UsImCd9BtxxH3ChWJo4Vzs lPclVm7SUrLpSdMH2JnJkw9ufTAIlQa6Pu+vCtFC1y/vvzFdIqsAHTBx8flhADz0/H6v IMwbBHep1lFrO8hn2p4rz5fZtv4W/6zCxBIwUlga9J2y2xcEhRZ+C3mS43yKU9HPt18A Zil8K8FcNPNI6WVzo5Z+szdBfKkIzv48XPZbIhV033jxFWmAVM0fQ6Cyq8J30MLfcK79 DJQM+9QKtHsc0G46x0wbGfiIVZjUzrnY6Yg852QGhkdiEaw+RurF2IEW+JrSIm5vU5Ty o0/A== 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=iiFCG3CqmowUuO/RTDZuVABDAvYDXz5Z7dqSw4bCx0k=; fh=6REE+IrRuoNqx2jK0ROVuQ6lzfIutKP53rjELw6ww0Y=; b=J5saPSMzTnIv77l1wRseWkGY7FtwRe8QwjVYttVCg4RHAQg/UdS9fYoZiti5V9F42U JY6kDSGuC3Fru22/CDM3xxJYYOZJkuDFDYK6Zxr8ieP/GU440IlE9kjTe9HcwcMHRkWe F/+1azSM7WYyWkbaeiqLOngJygj7ac/WnZ79XfBsKx6x3Cz4l0+mSgVSjIDL7Fc77s4F kqzpBowOhSYbY2UVlI6y/WYmnIHOOiNokKKRXWbezjjjTYIqdanVDzK4By8oHIvxI7NP uGIRYLP0nVP29BTKToVPWlm2OfJNRTEoUf0SUW6m3whwzk0yY/QAfawCFuWm58gN9qji G21g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nE+DVXHz; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCXB9RNDVhyUADy2bKuHi9epG76ltFpGjROT0HVgR+eG8ulhDJVHK6F6cgc0HVwgnsnSc8z4q1NQqdL80DMkE9bzAdEbf31JhCOUGPlxFA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gs4-20020a056214226400b0068c9c9584ffsi351464qvb.500.2024.02.12.05.20.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 05:20:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nE+DVXHz; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 726681C21A8A for ; Mon, 12 Feb 2024 10:15:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3472D182BD; Mon, 12 Feb 2024 10:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nE+DVXHz" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 07C581804A for ; Mon, 12 Feb 2024 10:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707732901; cv=none; b=TLI3mbmwVpAAQjsd1EatC8zzPAN1GNij7MFDR/f7bt8dcvDygz1s14dyzKDMQc1dt4TPltLHfmbWwYtYGenF78lj69wltz1wE5mZFTqeYRCR7P1zXvhnk2E5/zUBYAUQMXfY8eEx9CJ/6hRrljNe7CL3MILyGoRsU2DbdRF5Ess= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707732901; c=relaxed/simple; bh=CWJ/MFKYCbhsiN64n9KR0XkaQPc+SgsXxhtc0auXCr8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OEt8WeY/AFTnRMsAosJNIaqKOrtshqivDF5T2EvD8yyobIABlNebYRlCsH9U5rAuels8vMZAB/ve02B6MfezmG3M5I+1tYxBiKdqsY/ydbUVPd2YY6forkvbAzjl7cLcc23XrX0yOqItYry9QIQBoZGqy8nXTnDKLeuCOkGLAOM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nE+DVXHz; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707732900; x=1739268900; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=CWJ/MFKYCbhsiN64n9KR0XkaQPc+SgsXxhtc0auXCr8=; b=nE+DVXHzps/VRoK27Jn4qfmptD5jEhIyraKyVHj0YMksGUqQv9C/UBqq qJh+a1894bpUPJVI/hTLsp1OhJUUNZeXUOeVqaWvk+lU7cmaaBIDHEDLg E+EHVa20Cr91SkZIbxmtYpa7NH8EiRklM4GDc5EWPSUt2NO/s0iTrsQZa TaQVtVe+n7Vx71bugHLZYbIeqysPOiVlbKHIXGpIZ/Jx0/Ed17K/3oTh3 kzFODS+KhvF8FFZJvBxddZjLeysOaBdl8TpwYiYZLlR5DZnGsJ11dfFp7 /m3AEeUOsu5KTL2qMSjgqyharqAOVMVBTTkZt3+Nxk1pu3+DeEZ9FzNok Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="5540883" X-IronPort-AV: E=Sophos;i="6.05,262,1701158400"; d="scan'208";a="5540883" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2024 02:15:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,262,1701158400"; d="scan'208";a="40008328" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2024 02:14:58 -0800 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id DED7D11F86A; Mon, 12 Feb 2024 12:14:54 +0200 (EET) Date: Mon, 12 Feb 2024 10:14:54 +0000 From: Sakari Ailus To: Greg Kroah-Hartman 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: References: <20240212094618.344921-1-sakari.ailus@linux.intel.com> <20240212094618.344921-4-sakari.ailus@linux.intel.com> <2024021210-freeway-unblessed-d966@gregkh> 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: <2024021210-freeway-unblessed-d966@gregkh> Hi Greg, Thanks for the review. On Mon, Feb 12, 2024 at 11:02:04AM +0100, Greg Kroah-Hartman wrote: > 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? Hmm. I'm not quite sure what you mean. The patch changes where the fields are assigned but the variable is only used when the assignment is done in any case, so this doesn't change anything. > > 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. The only caveat in initialising a struct is that the possible holes due to ABI aren't initialised, which generally is a concern with UAPI or network (i.e. not here, and the patch doesn't change that anyway). -- Regards, Sakari Ailus