From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759269Ab2DKWtZ (ORCPT ); Wed, 11 Apr 2012 18:49:25 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:49475 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755281Ab2DKWtY (ORCPT ); Wed, 11 Apr 2012 18:49:24 -0400 Date: Wed, 11 Apr 2012 15:49:20 -0700 From: Greg Kroah-Hartman To: Xi Wang Cc: Jesper Juhl , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Joe Perches , Dan Carpenter , Forest Bond Subject: Re: [PATCH] staging: vt6656: Don't leak memory in drivers/staging/vt6656/ioctl.c::private_ioctl() Message-ID: <20120411224920.GA1612@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 11, 2012 at 06:46:33PM -0400, Xi Wang wrote: > On Apr 11, 2012, at 6:35 PM, Jesper Juhl wrote: > > > - pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC); > > + pNodeList = kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC); > > Can you also remove casts like "(int)GFP_ATOMIC"? > > The parentheses "(sNodeList.uItem * sizeof(SNodeItem))" are also > pointless.. One thing at a time, odds are this is an "automated" patch, right Jesper? thanks, greg k-h