Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp953040lqp; Fri, 22 Mar 2024 00:25:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQStXk4QDzW7U1ZgY9nCLFrYNIpl5kXJim5TAS3+OnAOL1wS7gYg2+1hEYaVl4hwaqVJtNd0/EdMe976fpNIgDJyqavbI8WyKZDj+aHg== X-Google-Smtp-Source: AGHT+IHGGHqokTKSCVsab9YeLMveozwIuA2yREhl1cjUNz+iM8kggcmz0Bu5W/OPGGAeRZbrtIHX X-Received: by 2002:a05:6102:2325:b0:476:6ea7:3389 with SMTP id b5-20020a056102232500b004766ea73389mr1373179vsa.2.1711092344110; Fri, 22 Mar 2024 00:25:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711092344; cv=pass; d=google.com; s=arc-20160816; b=balbaC+/jsGe+kiLfbjOacBRqsAlIYsZGPGIeNXxCLl6Bj50uQbCtozmtPaNd11l+C ulMwk4BUh1QcIlpg02Eas8Kg9ySiRgWvuVmq9X9tisfevN77vVf76qTDLfK94oK38ki/ 49UL+3rXC49r0O66NKB5dOQ/3wy4ATsg9px+XegOjtzWscc0S/g6MjtepgC4sqm3V+id 4iXAiXi+7xRQMb8VVFiRCJo57XQi2pSg2EUDe0JWFJ66Y0fO/9XN7I+BRhv6lW6tZxvf U/RSjsCAxw5HYbvvGzyEVvuh+R7CSldNckNC17ZlVH0EJ9HNJJ8E8q1Rzao6CJabqZ3y uXLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=ZlmxMcxkID2APtdDfuPjyw9p7ZsnzMLqcX7Pogi+DwM=; fh=+TSAD77R7uuu56wld67S3Posr4/xz/yPwvB7cbeiQMI=; b=jJkPYCEw464Fn1ayc1JkrXBKm88bZE5LzLatb9UpmmQOJxTVhJJzbWUyDzl0iaab5q RHsZGdZ1UVT8BmR0R0uFFICzIpDLQItpScrYULzdoYowP3B9gqtR+7bIVLt8qNMijDnI JOkAonY2sjSBRUqI54FY3pRmZP8Z+GELbUcqq4sr+Pm55aFZWyzN0gLbp+qjRNnHu3Ht uShHNmmKkjzX13J7MSnL4vTGCEyZ3bH7zlB5FxVkGQOy6vKMbQ3DnhZ5HKDxeLYVkz4k BJtyDMea1g+v/+YINWTlGh7y8j8SpJ4UG/ZU02EF2U2H+dnpjSCm155ccGxOgGdYE78o id4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=S3gBIDuJ; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-111058-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111058-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u18-20020a05620a085200b007885a44ec02si1375799qku.270.2024.03.22.00.25.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 00:25:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111058-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=@inria.fr header.s=dc header.b=S3gBIDuJ; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-111058-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111058-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr 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 D1EA01C23786 for ; Fri, 22 Mar 2024 07:25:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D3E615AD0; Fri, 22 Mar 2024 07:25:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="S3gBIDuJ" Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (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 20AEF1119E; Fri, 22 Mar 2024 07:25:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.134.164.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711092322; cv=none; b=JeU+0PbCqC++9LxInZIG2/YVq30vrIQAEhZvCNaEch2PmnFxsHbRGN6XezZ8tdet+UoABCzvb8Q0kp8Q7ZDuQO/zSZgZBSvpC6ZRwmmnLoo0NhOKed3gF8curoDbMn0FP+sXnoVZ0XScAu9hKb/qumrVcg+UB4xRWp7XIbhT/iM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711092322; c=relaxed/simple; bh=deldEFKMWIiGWJW2Eh0gw1DLVhU5F6dOnznP2xCyQaA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=UYYiBWEJb/KkpO3NiLBZ0AaB05BsN99VIxiqHt0mfjUqwDS6Hgbuqdu4MwiD3C1Dr/UdJQTqQ11Vy5yj3RaGFDR7PlRCPfbfnlHpW1URE0f4dAnrrYYLqyijvXJVQ9LnjRqyvJnDD+zRQDrQksFdz8eZdgLvdnK6bIWXhWn7c7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr; spf=pass smtp.mailfrom=inria.fr; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b=S3gBIDuJ; arc=none smtp.client-ip=192.134.164.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=ZlmxMcxkID2APtdDfuPjyw9p7ZsnzMLqcX7Pogi+DwM=; b=S3gBIDuJwtLpODXitOZtu7d+JPZWfXlEKDDRrdpd91mZdDnU9XwPNv8W A/DxwGKelRp0rlpAxQ1BO9ZhYMblxfbkn2sIqF2ykNh785PtT94jrqPBV WFQKUyPTqj7gip27FdT+S/UnWpXzytrLuU2RB35RjvKHJ/0bs80Z9Xdlv 0=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.07,145,1708383600"; d="scan'208";a="157923739" Received: from 184-074-243-067.biz.spectrum.com (HELO [172.20.17.26]) ([184.74.243.67]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2024 08:25:08 +0100 Date: Fri, 22 Mar 2024 03:24:56 -0400 (EDT) From: Julia Lawall To: Jakub Kicinski cc: Jesse Brandeburg , Julia Lawall , Andy Shevchenko , Dan Carpenter , kernel-janitors@vger.kernel.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, 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 In-Reply-To: <20240321184828.3e22c698@kernel.org> Message-ID: <82b49991-eb5a-7e8c-67e0-b0fd932f40b4@inria.fr> 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: multipart/mixed; boundary="8323329-551105037-1711092310=:3390" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-551105037-1711092310=:3390 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 21 Mar 2024, 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, > > which I also agree is a reasonable style for this. It more clearly shows > > the __free(kfree) and the allocation (kzalloc, kcalloc, etc) on the same > > (or virtually the same) line of code. > > > > I'm curious if Jakub would dislike this less? Accept? > > At present I find this construct unreadable. > I may get used to it, hard to say. > > 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 ????️ In my experiments with of_node_put, there seem to be many functions where removing the frees makes the function much more readable. But kmalloc/kfree may be used in different contexts, where the management of the memory is a smaller percentage of the overall code. So the tradeoffs may be different. julia --8323329-551105037-1711092310=:3390--