Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225Ab0HKOfr (ORCPT ); Wed, 11 Aug 2010 10:35:47 -0400 Received: from mail.perches.com ([173.55.12.10]:2384 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752648Ab0HKOfq (ORCPT ); Wed, 11 Aug 2010 10:35:46 -0400 Subject: Re: [PATCH] DRM: Replace kmalloc/memset combos with kzalloc From: Joe Perches To: dave@gnu.org Cc: Dave Airlie , Dave Airlie , eric@anholt.net, dri-devel , LKML In-Reply-To: <1281532732.2067.11.camel@cowboy> References: <1281532732.2067.11.camel@cowboy> Content-Type: text/plain; charset="UTF-8" Date: Wed, 11 Aug 2010 07:35:44 -0700 Message-ID: <1281537344.3976.32.camel@Joe-Laptop.home> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 946 Lines: 25 On Wed, 2010-08-11 at 09:18 -0400, Davidlohr Bueso wrote: > memory allocation in drm_bufs.c is followed by initializing the memory with 0. > > Replace the use of kmalloc+memset with kzalloc. Perhaps kzalloc's with a multiply could/should also be converted to kcalloc. > + entry->buflist = kzalloc(count * sizeof(*entry->buflist), GFP_KERNEL); entry->buflist = kcalloc(count, sizeof(*entry->buflist), GFP_KERNEL); etc. > + entry->buflist = kzalloc(count * sizeof(*entry->buflist), GFP_KERNEL); > + entry->seglist = kzalloc(count * sizeof(*entry->seglist), GFP_KERNEL); > + entry->buflist = kzalloc(count * sizeof(*entry->buflist), > + entry->buflist = kzalloc(count * sizeof(*entry->buflist), -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/