From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753828AbbJAPFk (ORCPT ); Thu, 1 Oct 2015 11:05:40 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:38446 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752718AbbJAPFh (ORCPT ); Thu, 1 Oct 2015 11:05:37 -0400 Date: Thu, 1 Oct 2015 18:04:50 +0300 From: Dan Carpenter To: Ronit Halder Cc: Lidza Louina , devel@driverdev.osuosl.org, Greg KH , DaeSeok Youn , driverdev-devel@linuxdriverproject.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: dgap: fix memory leak in dgap_parsefile() Message-ID: <20151001150450.GE7289@mwanda> References: <1443593385-7124-1-git-send-email-ronit.crj@gmail.com> <20150930114804.GG7340@mwanda> 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) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2015 at 09:11:31AM +0530, Ronit Halder wrote: > The existing dgap_parsefile() rejects invalid config file. > But before we know that config file is invalid a lot of memory leak > can happen. Removing the chances of memory leak won't heart anyone. > Why not just reject it earlier instead of allocating more data? regards, dan carpenter