Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp849451lqp; Thu, 21 Mar 2024 18:57:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUIqQkWvpdVhO8zjcwvCmT0iDEprj2NB9xC+RfN0iH8lqUvMqqWKmm659AwQqj458uNLdurKosEESHXxnHCSbFxbvNq1zKpqAPs7Sp10g== X-Google-Smtp-Source: AGHT+IH6xI0I7qhfU/tNWAgHFQdAMegMd/jU7hEEAYZpoEk27dDQN9C9B/W9PkfK45Ix5EvxbIjO X-Received: by 2002:a9d:7d86:0:b0:6e6:81a3:bdb with SMTP id j6-20020a9d7d86000000b006e681a30bdbmr1159350otn.4.1711072623583; Thu, 21 Mar 2024 18:57:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711072623; cv=pass; d=google.com; s=arc-20160816; b=j/lXkv5+qOIX6M3oISyyfcS398OryVifDdCnrIsJ0og+mlrIElj5OtNEjPacgFH8M1 WavsjiwrP3Es0Wqm7Oa+6XR8pERxd36MJzQk5PLN1LbJfNxmX/9DDKK6ZyFSEcJIlPqc Ltb0RFHmy0C3EHXkYaUtg0ZUX1i6AJNL4D8CQfr1qr6euKPnNRUgwgHs6QHZ0iD6S3oA vQeiQuIRCb0T5KTJkYDVD+Tk1RRAqqsZ0eZHFHuCU8rq1+CYFjkCkncUyqM/TJbgVPqO JovEC6y2KNRuVfYrnxX/fEUmlWIupkvpV6UWdlcfJsTrVX2HZq+Ps7hxiJ2gJotz/amQ UkcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=VoG0W9cXpUwH6re37sUzDR/3HQQQ2d4OzANWiCt7eqA=; fh=3D0cnBRJwl+OAzpLPlUNIwdJgUeSozf47DBk+do0OHE=; b=cfnTpR7NqLzu48RF3RQEn/wuM/SVBSzbJvoz1Ktev/MGJxxyfMnYPWDXE7oarIwift NU37Ik9nh3NrnKf4ay80zAFrsN9kjM9PWqQ8Zxhr/TV4KE70lH0beo7kXZddXa7NPARJ JztqP0cIqzKB9atnP4Y5hDA1QJoNOq8gDxsEl5QO0TSAq06AYf5uKcToIchk/6oEWOfN YOgn8we+FdTHY/acdw+FQCHiTR+HR9ghFcopuVK2y9FcDZTe4frIYt+7KwqzAQJI5RhK +6RsLjQV/1pxM+0I14QCvCXGeXv9zdmk2kv3u6jPa0zxcbxwRiYw63Y8/miaFl2XCOIP zMeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LaFzIh36; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110866-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e25-20020a630f19000000b005dc8914839bsi929389pgl.5.2024.03.21.18.57.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 18:57:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LaFzIh36; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110866-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A5090B22803 for ; Fri, 22 Mar 2024 01:56:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4B953FEF; Fri, 22 Mar 2024 01:56:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LaFzIh36" 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 D559565C; Fri, 22 Mar 2024 01:56:42 +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=1711072603; cv=none; b=buN1fciXtwkJY6IwfrT6xy+dDybajTzMPQn2tLFrBFUbv8rphbUKg4yU0dwJetY4tu9+o/ctWjn64y5UNXa3kERXNck+IwEG3uk4Uf0wZWy3sGnxzI2ombWrjSG8AoNQ4xGTPCULYUJRCZOGbCV8TRZd9HjjQ0Iq0JgnhAxOVy8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711072603; c=relaxed/simple; bh=VoG0W9cXpUwH6re37sUzDR/3HQQQ2d4OzANWiCt7eqA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aZ4bSgB9+sSyvSkwATpbUPFvSBXi9/hTuKqQruvcbRd1ejbbIk3vToXdkHBSWZFto0sd3PvmVmy4lU5QgobefduuRCkeIeFt2+gXbJ4hJqdYR8h72IYybg5ULCvJErTSd5e+8e5yjw7/+Ys+1tgd0XWH3OvcRHfemTpGg1Sgfng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LaFzIh36; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52266C433C7; Fri, 22 Mar 2024 01:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711072602; bh=VoG0W9cXpUwH6re37sUzDR/3HQQQ2d4OzANWiCt7eqA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LaFzIh363xEb2xBjcqJ3SOcCyKEL/L67LYR5OhXklrOKxt3Nz/OGhpLG05Yuobz7p UvoMEhEA7v+/3aJsiURC9gCniS1REFMiJdsce1HmxK1xdVDh1SKv6KrGz/NH0tEhY9 2Y3pzzk+2cPes5r3lzCLxMBaBy3oIFhHAyy/4qxnTqtZpnyJlGMBHoWuV6Doeo8Puk B1Zj9RhDpuiP7JXzUOY8kv5T5b+aqlTmWUfBVOHtRQv8yY2MQbmqlwAf8kigBwwtou mK8/k2zw/4vl236jVzvXqwSQqM8Jy6AvMcZ8gj/yTO237VDOyAML220QcqcJ2MiqO0 9cAKzemKsVqTA== Date: Thu, 21 Mar 2024 18:56:40 -0700 From: Jakub Kicinski To: Jesse Brandeburg Cc: Julia Lawall , Andy Shevchenko , Dan Carpenter , , , , "Maciej Fijalkowski" , Przemek Kitszel , Tony Nguyen , LKML , Alexander Lobakin , David Laight , "David S. Miller" , Eric Dumazet , Jiri Pirko , "Jonathan Cameron" , Kees Cook , Lukasz Czapnik , Paolo Abeni , "Pucha Himasekhar Reddy" , Dan Williams Subject: Re: [PATCH net] ice: Fix freeing uninitialized pointers Message-ID: <20240321185640.6f7f4d6b@kernel.org> In-Reply-To: <20240321184828.3e22c698@kernel.org> References: <20240321184828.3e22c698@kernel.org> 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 21 Mar 2024 18:48:28 -0700 Jakub Kicinski wrote: > On Thu, 21 Mar 2024 15:27:47 -0700 Jesse Brandeburg wrote: > > The gist of it is that we should instead be using inline declarations,= =20 > > which I also agree is a reasonable style for this. It more clearly show= s=20 > > the __free(kfree) and the allocation (kzalloc, kcalloc, etc) on the sam= e=20 > > (or virtually the same) line of code. > >=20 > > I'm curious if Jakub would dislike this less? Accept? =20 >=20 > At present I find this construct unreadable. > I may get used to it, hard to say. >=20 > Also I don't see the benefit of the auto-freeing construct, > I'd venture a guess that all the bugs it may prevent would > have been caught by smatch. But I'm an old curmudgeon stuck > in my ways. Feel free to experiment in Intel drivers, and we'll > see how it works out =F0=9F=A4=B7=EF=B8=8F On further reflection, yes, of all the bad options moving the declarations inline in this particular case is probably the least bad option.