Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp549140ybg; Fri, 12 Jun 2020 08:21:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyG0c+t3JUlUlCAhj08x4iP/Y/d5t3meFNK9U9uJu4VXit8002ajXGP8tv77XYlAreBMaGS X-Received: by 2002:a05:6402:b5c:: with SMTP id bx28mr12226798edb.145.1591975288761; Fri, 12 Jun 2020 08:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591975288; cv=none; d=google.com; s=arc-20160816; b=ItHlFzdJLxQonMCti0+DUD82H/N7nM1L13XFTbcOmn91uAx4YnQzjWeiMXie5GaF+G Lbgq103w4RwhXfnRMHaSE+bEsCuTrsOdG/Dl8Pwbw1NV/hDawdsxrJmuCbHfMD/5lbim mTqSwC41xlukPFgWpYDUqNZHhceaLg4cQViLtC5HFmUB5V7lVfYqRfz/w/ZOl4IcDpY4 gulOpFn/zcQsOT/RihC+VTCFq6D7zGuCGLciT9T+F4TY0ey63a9dZe7Bxke3xNYz3D84 8QTFRVHObCkNsS7XLpdOo7LuZ0CLvDlkmsy7Bk3mjnKUFXFGSAicD4y5651qdUDiljx/ FX6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=8kSCIcd2ES6zxIIr0tLBdHS7S3v11+nZISytwRYlnYo=; b=lEOA5VGAC3wegU4gjOqwKm+6QF95FrWOYmwy1pz9bsn6SBzWM84tBzMflz36/gWNh/ ffblF9bOUyfFO+UoBaD1abqIFcS4Fr8sdVNfjQ7vUmq+1ElY0u91du9v86H7qXdmUd8C 7fa8moVhZzdXJjcn3CZMWN40oO2lwClrlkQ9bqPDoVqjOREjdSwJuvguFsLmh/WSznBv p9z7l1JNc5bbLR83SkzcTn1h7TCkTLvt+Bgk8T5W+ybaA3QhqL9tj6sT9hEXpUHJ6N31 ONquB3kvL8ulePnJlLJRwIcgdGlz4dQH2aKT5NIeIb1PF0tFCBdHzgk0E8+nzSzTm7Z3 oTPA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si3767109edr.177.2020.06.12.08.21.05; Fri, 12 Jun 2020 08:21:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbgFLPTR (ORCPT + 99 others); Fri, 12 Jun 2020 11:19:17 -0400 Received: from smtprelay0012.hostedemail.com ([216.40.44.12]:56422 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726085AbgFLPTQ (ORCPT ); Fri, 12 Jun 2020 11:19:16 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id CD2A7100E4720; Fri, 12 Jun 2020 15:19:14 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2828:2895:2901:2911:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3870:3871:3872:3873:3874:4321:4425:5007:6119:6742:7514:7903:10004:10400:10848:10967:11026:11232:11658:11914:12297:12740:12760:12895:13069:13095:13311:13357:13439:14096:14097:14181:14659:14721:21067:21080:21212:21433:21451:21627:30012:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: toy64_4f084a126ddd X-Filterd-Recvd-Size: 2858 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Fri, 12 Jun 2020 15:19:12 +0000 (UTC) Message-ID: <0b82952a6e0b4a05c93f4d18b3d0b2f43b61ab98.camel@perches.com> Subject: Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc From: Joe Perches To: Jesper Dangaard Brouer Cc: Gaurav Singh , Alexei Starovoitov , Daniel Borkmann , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , KP Singh , "open list:XDP (eXpress Data Path)" , "open list:XDP (eXpress Data Path)" , open list Date: Fri, 12 Jun 2020 08:19:10 -0700 In-Reply-To: <20200612140520.1e3c0461@carbon> References: <20200611150221.15665-1-gaurav1086@gmail.com> <20200612003640.16248-1-gaurav1086@gmail.com> <20200612084244.4ab4f6c6@carbon> <427be84b1154978342ef861f1f4634c914d03a94.camel@perches.com> <20200612140520.1e3c0461@carbon> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.2-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-06-12 at 14:05 +0200, Jesper Dangaard Brouer wrote: > On Fri, 12 Jun 2020 03:14:58 -0700 > Joe Perches wrote: > > > On Fri, 2020-06-12 at 08:42 +0200, Jesper Dangaard Brouer wrote: > > > On Thu, 11 Jun 2020 20:36:40 -0400 > > > Gaurav Singh wrote: > > > > > > > Replace malloc/memset with calloc > > > > > > > > Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info") > > > > Signed-off-by: Gaurav Singh > > > > > > Above is the correct use of Fixes + Signed-off-by. > > > > > > Now you need to update/improve the description, to also > > > mention/describe that this also solves the bug you found. > > > > This is not a fix, it's a conversion of one > > correct code to a shorter one. > > Read the code again Joe. There is a bug in the code that gets removed, > as it runs memset on the memory before checking if it was NULL. > > IHMO this proves why is it is necessary to mention in the commit > message, as you didn't notice the bug in your code review. I didn't review the code at all, just the commit message, It's important to have commit messages that describe the defect being corrected too. Otherwise, a simple malloc/memset(0) vs zalloc equivalent is not actually a defect.