From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B29DC54E58 for ; Fri, 22 Mar 2024 01:56:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 88E4B41712; Fri, 22 Mar 2024 01:56:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AT-aFXJk3mqd; Fri, 22 Mar 2024 01:56:46 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 929BA41708 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1711072606; bh=VoG0W9cXpUwH6re37sUzDR/3HQQQ2d4OzANWiCt7eqA=; h=Date:From:To:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=p6o+/u2XuLXOjhpCZZjHL9QeEd4ljvJmE+hU/xCPJCxsIk/N+Trtd4JxDQli8SL2f hGdHvzji3wKK9IUNZJXBDzlU2YsRsQNt6aUOLMaqIwNbxDftdnrnIjf3Tl4pgwsxfe YXvflGL+KIN1SA3jyFQFZhtUHda74ouienIU7F3mZqVc/snDe33BSJTKH2rNI6sujI N3ZLiihwyDw0WM2qQOwcqAnSzMHLgwrhAUu5wDhl30BxIGpN81Uuxnak0Pskk5TQ3y EESNH8A9nv+IdM8tgxyO1+ZvH8uGqG2zNwZGJgzhPyqTSzdwitGbvIFdRkvYCS7oQ1 BhaqgLFYcsYfg== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 929BA41708; Fri, 22 Mar 2024 01:56:46 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 2324D1BF25B for ; Fri, 22 Mar 2024 01:56:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0EDDA60F42 for ; Fri, 22 Mar 2024 01:56:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aElE-U9dBfJJ for ; Fri, 22 Mar 2024 01:56:44 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=kuba@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 1762160899 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1762160899 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1762160899 for ; Fri, 22 Mar 2024 01:56:43 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B2DFB61210; Fri, 22 Mar 2024 01:56:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52266C433C7; Fri, 22 Mar 2024 01:56:41 +0000 (UTC) Date: Thu, 21 Mar 2024 18:56:40 -0700 From: Jakub Kicinski To: Jesse Brandeburg Message-ID: <20240321185640.6f7f4d6b@kernel.org> In-Reply-To: <20240321184828.3e22c698@kernel.org> References: <20240321184828.3e22c698@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Original-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== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=LaFzIh36 Subject: Re: [Intel-wired-lan] [PATCH net] ice: Fix freeing uninitialized pointers X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiri Pirko , Pucha Himasekhar Reddy , Paolo Abeni , Maciej Fijalkowski , Kees Cook , netdev@vger.kernel.org, Lukasz Czapnik , kernel-janitors@vger.kernel.org, LKML , Julia Lawall , Alexander Lobakin , Eric Dumazet , David Laight , intel-wired-lan@lists.osuosl.org, Jonathan Cameron , Przemek Kitszel , Tony Nguyen , Dan Williams , Andy Shevchenko , "David S. Miller" , Dan Carpenter Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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. From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LaFzIh36" 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: kernel-janitors@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.