Received: by 10.213.65.68 with SMTP id h4csp2725153imn; Mon, 9 Apr 2018 08:05:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Te0ioXHOdHgOEV0QW6iulWXDQjrEPDDAnLHPVZSAgk5HWDhhdseKL3pV/RtMNvwnZmceb X-Received: by 10.98.137.15 with SMTP id v15mr29264959pfd.95.1523286312232; Mon, 09 Apr 2018 08:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523286312; cv=none; d=google.com; s=arc-20160816; b=FpIl34Db78RHgNQIybHG98uHUNPNW9aXlqn0oNgTD3f9b0w5JqmlrsKpqP2cqPxpG7 cvocnfd6YY4H+HvLtq1VjWszDb8dgnpCQOW1fkObD8B1UuW3lK+/4XuVMZXW0qVyZjPZ kgA+mU3sPE3PYF5joCkkkXzAnoCzP94/pfH/+Ib19BeDpdbHhMMUEss1zC5IA/YD3hqS iStY1YBy+dgBHkQXH5/JqEdCUAMAwle80B19vbMzFdO+Xo4BVQ6QfFlhIoNOj6fuH932 RubRA/1LNUpXGIpX9y4FXmFLm7mIwudY+JxvEjJEmhUH773zm+474GUgV9OVs25SUjPs idPw== 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 :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=NjVM/k4H3Bqdr4EQl0Zu3u+EgKgiuE3paYaPut/OJiM=; b=CXf6kgIkpiuhVlVuoF9KPjI+gyROqtogUdW+4JyoVxl/okVvZGf4az94j6JN83k2eZ iEJ5PmtaS3chwidGXOOZQ4+JYwCSI382e1u40JZhJiEBuX0Pe//XJ4o1c/EuBaepp11T x6zcPQnX/JTqC2RIbmPmJkgVuEoxqrlou7iU5FvUtbvFqQDh1NnPQLooVdkAN/JE86el P0jvZg1JyzBUJyh52W2jJvnCmJ3J7vfi7sVgH5DsOwlGW9EH3IwHyl8GX4Ixo0Klh+xX 3h+OrDrVXwFBsXfpRb3kwBxOtWZcjMSNaKaaqSqG77aVCLeTcjqwPOC7qRi3CP/NFYVZ M5+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i90-v6si453750pli.717.2018.04.09.08.04.34; Mon, 09 Apr 2018 08:05:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752892AbeDIPAV (ORCPT + 99 others); Mon, 9 Apr 2018 11:00:21 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:50128 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751623AbeDIPAT (ORCPT ); Mon, 9 Apr 2018 11:00:19 -0400 Received: from localhost (unknown [172.58.225.250]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id C55D5141BE048; Mon, 9 Apr 2018 08:00:17 -0700 (PDT) Date: Mon, 09 Apr 2018 11:00:16 -0400 (EDT) Message-Id: <20180409.110016.166919257730352493.davem@davemloft.net> To: Vadim.Lomovtsev@caviumnetworks.com Cc: sgoutham@cavium.com, sunil.kovvuri@gmail.com, rric@kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dnelson@redhat.com, robin.murphy@arm.com, hch@infradead.org, gustavo@embeddedor.com, Vadim.Lomovtsev@cavium.com Subject: Re: [PATCH v5] net: thunderx: rework mac addresses list to u64 array From: David Miller In-Reply-To: <20180409132448.22278-1-Vadim.Lomovtsev@caviumnetworks.com> References: <20180406195354.16037-1-Vadim.Lomovtsev@caviumnetworks.com> <20180409132448.22278-1-Vadim.Lomovtsev@caviumnetworks.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 09 Apr 2018 08:00:19 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vadim Lomovtsev Date: Mon, 9 Apr 2018 06:24:48 -0700 > From: Vadim Lomovtsev > > It is too expensive to pass u64 values via linked list, instead > allocate array for them by overall number of mac addresses from netdev. > > This eventually removes multiple kmalloc() calls, aviod memory > fragmentation and allow to put single null check on kmalloc > return value in order to prevent a potential null pointer dereference. > > Addresses-Coverity-ID: 1467429 ("Dereference null return value") > Fixes: 37c3347eb247 ("net: thunderx: add ndo_set_rx_mode callback implementation for VF") > Reported-by: Dan Carpenter > Signed-off-by: Vadim Lomovtsev Applied, thanks.