Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbbLRF0z (ORCPT ); Fri, 18 Dec 2015 00:26:55 -0500 Received: from mga02.intel.com ([134.134.136.20]:1255 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750740AbbLRF0x (ORCPT ); Fri, 18 Dec 2015 00:26:53 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,444,1444719600"; d="scan'208";a="874017174" Date: Fri, 18 Dec 2015 11:00:08 +0530 From: Vinod Koul To: Mans Rullgard Cc: Viresh Kumar , Andy Shevchenko , Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Julian Margetson Subject: Re: [PATCH] dmaengine: dw: fix potential memory leak in dw_dma_parse_dt() Message-ID: <20151218053008.GS1854@localhost> References: <1450395058-23442-1-git-send-email-mans@mansr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450395058-23442-1-git-send-email-mans@mansr.com> 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 Content-Length: 754 Lines: 19 On Thu, Dec 17, 2015 at 11:30:57PM +0000, Mans Rullgard wrote: > If the "dma-channels" DT property is missing, the dw_dma_parse_dt() > function return NULL, but not before allocating memory for a struct > dw_dma_platform_data through devres. If the device supports parameter > detection, the probe still succeeds and the allocated memory is not > released until the device is removed. > > Fix this by deferring the allocation until after checking the > "dma-channels" property. Applied, thanks -- ~Vinod -- 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/