Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1102323lqt; Tue, 19 Mar 2024 12:43:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWK187XYwqLiXWl7E84k+Jw6LUzxXRjR3yDQjqj6/6Qbzyoyvke7yTE0IWO70w8de+bmqD9yRZg6uvldlSOEaziIFmjzsmmwkVF4LH7uA== X-Google-Smtp-Source: AGHT+IG4V1cHUC+e9+JmDRVMuLB5314il7CMzMEgoImeZ7VGDbcO9D5xUYTidLpcz574fVjBGoKO X-Received: by 2002:a17:902:ce8d:b0:1de:eddc:9f9a with SMTP id f13-20020a170902ce8d00b001deeddc9f9amr187780plg.53.1710877412130; Tue, 19 Mar 2024 12:43:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710877412; cv=pass; d=google.com; s=arc-20160816; b=tI5K4DU3/gtr8VHwQn4QeKEWCV/xkEc9cg2n09F5w6AbPr1dM/NaXAzXLbxquR0Aww vm+iN/F1lNO+TbhfTLDFD3vGmGzDNmHuhhHh9KVAMquiC1ygOKh68+3jqp1Iw1NyyBhc 2WCTyRPGUD1+aQu55RAsapJnbujp9Zfeou+gUejm2hz2UyxuVz3IOD06MlNuDHZZS5sC Sr0v7cyUnQQ0Ru0yLru+1Abu1ZfG56ZWEndWGerWsMbwPWfOmIqWclVP1xgxhzzbtwHD Lho5ca3PPq27tHNzi2dFg7+tdT1wWHdMGqciS/uzaY/uNjfZ9F1V/OqwG48ADYDa9UGV CLlg== 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=cXi257JwpClcyBFTjwZNV/lnEYXUnxNwn0P+hzh0Jwo=; fh=ao35goAN9VhJViHJ98zGaIz56LAH0HFYL5AA02V8x7c=; b=0x2KrnUaX/CFHajOmXi5g3EDAaS+3nIkjfNc/GARpweDyjhe0CL4sP/qRvDBdfP+Lg dvjcFwnL3SZGs0spyNUP9dA/iFof3HXTM01tLqGqF4IdoK6u0wjef8ql2oVUgJmhhDTJ iHa+ZY4CuZinGKTP7d6MxUYkaIy6nc9paEiJ6ccobkJ+BoNMu8X1X2bjXRdIcEiHaUGT s1lMAgeda175/gl8Wv5BktnnvN68hkUzPzWBFvQ8u4Tnwk5Y1a7ez+1frRu4UQRAtJag 21BjfPUQNQIaTlWyT3IE43BLmZlzhEmxg54QYzRz8PchHyhaW7+Nf/HQn/OVixJ4IsQ/ fTwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hPj5lcGs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-108072-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108072-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n17-20020a170902f61100b001defe65c2f0si8232020plg.102.2024.03.19.12.43.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 12:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108072-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hPj5lcGs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-108072-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108072-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C9C0D284511 for ; Tue, 19 Mar 2024 19:43:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A6BC3B19D; Tue, 19 Mar 2024 19:43:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hPj5lcGs" 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 505D339FFD; Tue, 19 Mar 2024 19:43:19 +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=1710877399; cv=none; b=Byrp+JPi30yXsDVD/OFamzTbnskCDmdqgUM455ttmIm9/1haX8Lg7xjPG9sGbL6fu8fx60HYtCc2+OqyrXJir+APDvnUoyaZoU9gvPKUYUY5SV7s16kC+QS5kkG+PFILFy+tMPe859h0CvIBaoGky+8Xdr5xmlqBRqKDG3ebM90= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710877399; c=relaxed/simple; bh=4c0gTY5ILrK0uD6EsujNoi/J2gWpLE0huRdLKPHIfwg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=K8TLd7IZmow2i5uDTMa4yf/MzkKBAIvpOzQ0zDAOkuGL1Cgb+fRya4cmBFIlY57yySbY/okIZ8WShSzpY9d/Nn95W358sNEavImIZx4JezFe1EvdROvRqA93SAKSaVo4kRLjJuZIv5+L93EsxsGDWDrt8jJV3ynccOoIeL7SAtM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hPj5lcGs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A102DC433C7; Tue, 19 Mar 2024 19:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710877399; bh=4c0gTY5ILrK0uD6EsujNoi/J2gWpLE0huRdLKPHIfwg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hPj5lcGsZBFbWYX9sTipBmth0flulHxveKZSdSIYL9f9rnIFdPotJ6AjMBKD9E1Wx Sfu6LWJqHTQmjEHpqD7W6UVFp526dSluffT6r6Lkpy/tN0s0b0eV8IT1jY2Iuy0ot7 FnynRVm1UV0bQlEwjm7EfDD7x0rScmrqtfrz55YX5uqHh9z4my7KKb48L0CT3ZtJuj qhKbGM2CLqEXiHYNK2QyoEZaVjw82vdlfv2xfLQdrsFCy13lnNP+4BKRMzGuuO/lJx D309CxTY3kt0I5KXRslduxBgSvTFNf56Iju2LDEyAkGaQO0op5UzVkkZGzhYH46qsB 6mtHcRQkiIalA== Date: Tue, 19 Mar 2024 12:43:17 -0700 From: Jakub Kicinski To: Dan Carpenter Cc: Maciej Fijalkowski , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Paolo Abeni , Przemek Kitszel , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH net] ice: Fix freeing uninitialized pointers Message-ID: <20240319124317.3c3f16cd@kernel.org> In-Reply-To: <77145930-e3df-4e77-a22d-04851cf3a426@moroto.mountain> References: <77145930-e3df-4e77-a22d-04851cf3a426@moroto.mountain> 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-Transfer-Encoding: 7bit On Sat, 16 Mar 2024 12:44:40 +0300 Dan Carpenter wrote: > - struct ice_aqc_get_phy_caps_data *pcaps __free(kfree); > - void *mac_buf __free(kfree); > + struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL; > + void *mac_buf __free(kfree) = NULL; This is just trading one kind of bug for another, and the __free() magic is at a cost of readability. I think we should ban the use of __free() in all of networking, until / unless it cleanly handles the NULL init case.