Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp416760ybg; Fri, 12 Jun 2020 05:08:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8Q5CWcUmGMFct8sLoBlrPJKh8aQxV5RgH8Mr5UhzAPDAPlWVVdoYSKvRJbYEh7WQVD3TS X-Received: by 2002:a17:906:4c81:: with SMTP id q1mr13080489eju.273.1591963690070; Fri, 12 Jun 2020 05:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591963690; cv=none; d=google.com; s=arc-20160816; b=rf8Jb/1t85ZlAXvLLUuUJKq9lulXqtmJRpoXOlQUkR/AJZYAJf5efYSx+CCFEGdPs9 QzbsxHOl3IYcoV52hXnz5eaQ1zrwjtxyTY78lF3sHFwBa/nygBG/WT9Ygm1vVYz4u7AO Vh6C7bfCVCIYJ/ljNbs7tG9ED3Au9FqJqPLIEEDdOFscBnc4yWdnlJCxIY/thPiDBDjQ Xf2f3FLikOni6kCvvd7hiJQVYZayLVd7dPgzTri4rHEGInYSqlh8SdIWOemclhEo/mSj l1dCJidrvdhS7XiignKAkwmz7cU2nIMqwcdXCIgVkZ0h6X63XXTrtdf8QIte+4Z1cunk 0BbA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=g5ghH5RlSs+XTEgRPgodo5nKXtKIcrVv1ZEvWgXN4nQ=; b=ez0jMtiIqVnBsnYoxmTWeZjbWcAFEk7s65+w/dOZCAyQtNVRq8b2X6YczPAPaEvt0l Wbkj2gjVTHgalT0VEGqsQjDaJgPB1fVjS2chg0CmsyvfNtdQyZS+FLTV/XZ8uT7W/eLf K4k0Dt97scM0DTueKXmZfCAHE2MgFxJfb/eqnitvNgdTUwrTCwh5ukTf3v/joxmnZSrC X772SONF20S4yfwaSOiXV2xOL9lhNrgs8Y54iAUwDAVtaRh9bI1s5T9/WljoF9bPLurY d0f4/KGcnosYkRsTy0CJ5xqBUFVxQDvuscx+Vd4ftotNe5DQCxSlBZZ6lU4jv2ayhnLy +5Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HvbevyL1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc22si3567293edb.368.2020.06.12.05.07.47; Fri, 12 Jun 2020 05:08:10 -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=@redhat.com header.s=mimecast20190719 header.b=HvbevyL1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726327AbgFLMFi (ORCPT + 99 others); Fri, 12 Jun 2020 08:05:38 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:60401 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726314AbgFLMFh (ORCPT ); Fri, 12 Jun 2020 08:05:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591963535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g5ghH5RlSs+XTEgRPgodo5nKXtKIcrVv1ZEvWgXN4nQ=; b=HvbevyL1PdlL5pHmWpmWrmJ+ajiQHOja8990v1RtC+bmB5ugW4SG7s321xLwYyDhH20ZWZ TasFlAiqVHtzNHk5DDKMYoXc4YOHwpaGuElVdaKz6sP8SXkwkAR+BmeKd6VaSGaYsxs6WQ L1MFE7yuoK1gxmgT3r5tVDKvRq7L1rc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-cktZo0nPMsej_p0D-mUS3A-1; Fri, 12 Jun 2020 08:05:31 -0400 X-MC-Unique: cktZo0nPMsej_p0D-mUS3A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 504628015CE; Fri, 12 Jun 2020 12:05:29 +0000 (UTC) Received: from carbon (unknown [10.40.208.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25E945D9C5; Fri, 12 Jun 2020 12:05:23 +0000 (UTC) Date: Fri, 12 Jun 2020 14:05:20 +0200 From: Jesper Dangaard Brouer To: Joe Perches 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 Subject: Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc Message-ID: <20200612140520.1e3c0461@carbon> In-Reply-To: <427be84b1154978342ef861f1f4634c914d03a94.camel@perches.com> References: <20200611150221.15665-1-gaurav1086@gmail.com> <20200612003640.16248-1-gaurav1086@gmail.com> <20200612084244.4ab4f6c6@carbon> <427be84b1154978342ef861f1f4634c914d03a94.camel@perches.com> Organization: Red Hat Inc. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer