Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1016863pxk; Sat, 12 Sep 2020 08:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyufLQsf2TqqEQGiZc0xthg3GmQ6GXj0CmwLfKDM8mFw55BkdLbf3qAVOxSHBhs9GtLlZEH X-Received: by 2002:a17:906:6d92:: with SMTP id h18mr6256134ejt.405.1599923141800; Sat, 12 Sep 2020 08:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599923141; cv=none; d=google.com; s=arc-20160816; b=ZfBeUtk8f/5HGnROxKVj+/EbNcBSiDtjQc/M3ZWOACuk2xnutEpVXgjipMtHucKogZ aHjX4al9D8Lc+FCPrexGuvJDBR6wQy5bKtayQxa8u81T1V01xRuzha7oOurvUlPQWD8C DaNFQcr6o8ALDtOADsj5PDQubSt2KhWZT210s7m5l1IhEUL/A5qS/aqfAjcH7UKPRHrO Fl4zRbePMzMgvoDj9kj2UCPaTGbO4JRjEYSframFWRMlMH0liIp3y2go3W/mD6ysTFnJ JhOoyQ+mjbXWhdHC0OM9q646Pn2fHQ6QQuXgofYfiUhgFp7bVE+cNvp6Z4LLg5BpPqwq 7v5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PHPLhobBd0e5sUaQblgCpIPYUQHoY5o/1Cp57ZUClQA=; b=xR9yyhN5ySN8PddeNLBXnz0dTZ0ubkfi7S3VE+jMr7oDbI5HiJLGZvGqKlLQm6snX/ tohdpcNIKYXz7TNYnsxr257vdiL2dOkIpC+cMYE6TySZfPM3Hwso4ErDnNuyhNopVYSt 9G0ncRp6YHBo5md+XaDMWsUG7d1BGhm0Shs8yPUURwmEcWt++uGtobAIEAKGRF2e2yGN CzTchIFs2qi7GU//hFW7gwff5XusT1yEWqP2OxC7UiXABiVUNpZ9MQFJT7F6mM7018Of apy4llmDEv56oY+/vZ2Bo5VJqEK/rTKqIM0ObHh9kynZNJBXRWLO2UsbJFMp6Qj4W0sv rCsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wZC0P8vU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si3248419ejb.225.2020.09.12.08.05.18; Sat, 12 Sep 2020 08:05:41 -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=@kernel.org header.s=default header.b=wZC0P8vU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725850AbgILPBb (ORCPT + 99 others); Sat, 12 Sep 2020 11:01:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:46560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbgILOzY (ORCPT ); Sat, 12 Sep 2020 10:55:24 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D24C20855; Sat, 12 Sep 2020 14:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599922522; bh=qInZn1/egWCEWFvA4yvyOBeLuLl91HdsgrtXiTqOoz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wZC0P8vUa9KFX5+Mjhd/cZcHpQDema900na2XGcmJg0Ip4+qdgCDsLXYoN8mXLrW0 nBfrUmIwlaDvplV6wsKnHphRi1igdYpzuUygBSy4k216R7g+BU37xB1gsodpkJppsI OMdmH++O0NAxH0ErQHr0+1sajmWVgbgfq6lO7HMc= Date: Sat, 12 Sep 2020 16:55:25 +0200 From: Greg KH To: Anant Thazhemadam Cc: andriin@fb.com, ast@kernel.org, bpf@vger.kernel.org, daniel@iogearbox.net, davem@davemloft.net, hawk@kernel.org, john.fastabend@gmail.com, kafai@fb.com, kpsingh@chromium.org, kuba@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Using a pointer and kzalloc in place of a struct directly Message-ID: <20200912145525.GA769913@kroah.com> References: <000000000000c82fe505aef233c6@google.com> <20200912113804.6465-1-anant.thazhemadam@gmail.com> <20200912114706.GA171774@kroah.com> <09477eb1-bbeb-74e8-eba9-d72cce6104db@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <09477eb1-bbeb-74e8-eba9-d72cce6104db@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 12, 2020 at 05:43:38PM +0530, Anant Thazhemadam wrote: > > On 12/09/20 5:17 pm, Greg KH wrote: > > Note, your "To:" line seemed corrupted, and why not cc: the bpf mailing > > list as well? > Oh, I'm sorry about that. I pulled the emails of all the people to whom > this mail was sent off from the header in lkml mail, and just cc-ed > everyone. > > > You leaked memory :( > > > > Did you test this patch? Where do you free this memory, I don't see > > that happening anywhere in this patch, did I miss it? > > Yes, I did test this patch, which didn't seem to trigger any issues. > It surprised me so much, that I ended up sending it in, to have > it checked out. You might not have noticed the memory leak if you were not looking for it. How did you test this? > I wasn't sure where exactly the memory allocated here was > supposed to be freed (might be why the current implementation > isn't exactly using kzalloc). I forgot to mention it in the initial mail, > and I was hoping that someone would point me in the right direction > (if this approach was actually going to be considered, that is, which in > retrospect I now feel might not be the best thing) It has to be freed somewhere, you wrote the patch :) But back to the original question here, why do you feel this change is needed? What does this do better/faster/more correct than the code that is currently there? Unless you can provide that, the change should not be needed, right? thanks, greg k-h