Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbcD1SgL (ORCPT ); Thu, 28 Apr 2016 14:36:11 -0400 Received: from mail.kernel.org ([198.145.29.136]:50503 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751824AbcD1SgJ (ORCPT ); Thu, 28 Apr 2016 14:36:09 -0400 Date: Thu, 28 Apr 2016 15:36:04 -0300 From: Arnaldo Carvalho de Melo To: Vaishali Thakkar Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf tests: Do not use sizeof on pointer type Message-ID: <20160428183604.GC3386@kernel.org> References: <1461862017-23358-1-git-send-email-vaishali.thakkar@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461862017-23358-1-git-send-email-vaishali.thakkar@oracle.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 418 Lines: 13 Em Thu, Apr 28, 2016 at 10:16:57PM +0530, Vaishali Thakkar escreveu: > Using sizeof on a malloced pointer type will return the wordsize > which can often cause one to allocate a buffer much smaller than > it is needed. So, here do not use sizeof on pointer type. > > Note that this has no effect on runtime because 'dsos' is a > pointer to a pointer. > > Problem found using Coccinelle. Thanks, applied. - Arnaldo