Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3151170pxj; Mon, 7 Jun 2021 03:45:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDckXLe+UQJ+aQTHjMsCzqoeM0y6dqrZkZdDTV3TWQrFuyu3SDSa5Yo3b1DjUUXVxUEA3y X-Received: by 2002:a50:fd89:: with SMTP id o9mr19407144edt.336.1623062745691; Mon, 07 Jun 2021 03:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623062745; cv=none; d=google.com; s=arc-20160816; b=n26boCk+UhMIpjvQnjGKXUWoWjENYpIejj2QhZTuePwzy3zoZElL9iJx0DUN71hcOp Pr/SfttqhIQ63bG3AuKIjt2/WRgDf5I7tg+8CPGUswDrc1HROpXFax7ctmtpiO1xhUbu bOSSz4wANGO/rnRRdfeula+f9fZy4qJPLOAmDOwAYVQOogkYZ4nUCo5YxkPgku5ZjMpt QHILlmUyX37zb7bhixJdBKCFeeG+n+aOZtpFivlUS8Rd7jG9+JjdSzBHs4tILpPCWjcB u2Ppuk2aShs+TfzLxYeAUVeaf3FUQQNy31+rLrOHyaGw4GQdcuTg+zLzGvjAlPG/d55u CUEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4BySCnWuo2+hBh1Kf5OWJjhQ7R1JkUgp9tMIzaJrMgk=; b=Qv92OvEQTqvyyuLG5mAVzRscRSUSds8Ehrn1oYSNr57C5dEB/sMEmoBZlIKWApeADj Qe8ppTIH5xc+oRFgqlpUvCD86a0+VGyltXkpnkOGnVUxGsnq2EPJiGBRd/0HCVgmlneW 1jRjRFAIIgyU+Hw6PVVWBvMyES0KuykLYjBIjLmcSwubX79ZSU/7k+V5MP0ZBeAYOFSf O78GcYYfgYy+bDPo9Zt7ZPCe2/odIo80th9NQcM0V/Z1BcM3ECkIvTFNoadcKZFEab8s raO8K75qCUGS1djBv2boIgLAoDOiq9nRQjIaBWhCwC1HCgJdPj6vLnER0hGOBDXk+TRr bdfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=KjyQjqXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si15697937edb.395.2021.06.07.03.45.23; Mon, 07 Jun 2021 03:45:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=KjyQjqXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230241AbhFGKpt (ORCPT + 99 others); Mon, 7 Jun 2021 06:45:49 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48954 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbhFGKps (ORCPT ); Mon, 7 Jun 2021 06:45:48 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 157Af4xP013200; Mon, 7 Jun 2021 10:43:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=4BySCnWuo2+hBh1Kf5OWJjhQ7R1JkUgp9tMIzaJrMgk=; b=KjyQjqXg9EVzWPBgobqAP2wEVsZnCQD1DIfs0hrqpa4I11i45ER+unMsaVYL/txt98uM TRF+R6qlEKNskd7Ck5KzVtMf8az2/mvIZdxVKOWzliH7leOgOFqN9bL6pFqifOYYpR39 yIoGt2cfDH2qfHQYMHyxKu7nF3rh1LAIGveUrmSs6IVgfKZy8YNIevbz2tFR80Ks365L Sn+Qlx9lqalsVfBOlORCwmNe2vTldiuuaidTODWUYz+cIzqthHD/Nt212JXjGFABVkCi zOAvyM0oi6RJBHiciw0fU9V0YhQLUG7M10pMsGJHbV4S8c0ZOGLkGMQpB8DfzElr4Y5F jA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 3914quh3xg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jun 2021 10:43:47 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 157AfoIR033590; Mon, 7 Jun 2021 10:43:47 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3020.oracle.com with ESMTP id 3906spcf4w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jun 2021 10:43:47 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 157AhkA7068010; Mon, 7 Jun 2021 10:43:46 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 3906spcf3x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jun 2021 10:43:46 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 157AhiXV001715; Mon, 7 Jun 2021 10:43:45 GMT Received: from kadam (/41.212.42.34) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Jun 2021 03:43:44 -0700 Date: Mon, 7 Jun 2021 13:43:38 +0300 From: Dan Carpenter To: Greg Kroah-Hartman Cc: Wenli Looi , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8723bs: Fix uninitialized variable Message-ID: <20210607104338.GS1955@kadam> References: <20210606070021.116284-1-wlooi@ucalgary.ca> <20210607083316.GO1955@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-ORIG-GUID: MBkrJHtGGsCNe1LSbjgthg_VyBqll-n7 X-Proofpoint-GUID: MBkrJHtGGsCNe1LSbjgthg_VyBqll-n7 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070082 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 11:23:22AM +0200, Greg Kroah-Hartman wrote: > On Mon, Jun 07, 2021 at 11:33:17AM +0300, Dan Carpenter wrote: > > Greg asked about struct holes and the answer is "= {}" will zero out > > struct holes but it's not important in this case. The "= {}" is a GCC > > extension for zeroing structs and it's not part of the C standard. > > The struct has a kernel pointer in it so we had better not be shairing > > it to user space. > > I thought we proved that "= {}" will _NOT_ zero out holes in structures. > Or did we really prove that? I can't remember now, do you? > Assigning a struct to a struct will not initialize the struct holes. struct foo foo = *p; We worried about = {} and people looked at the C standard. The standard is not clear. But then people said that = {} is a GCC extension and will initialize the struct holes. The other thing is that in GCC they had intended "= {0};" to work exactly the same as "= {};" and initialize the holes but there was a version which had a bug and didn't. :P regards, dan carpenter