Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965596AbbLRB7I (ORCPT ); Thu, 17 Dec 2015 20:59:08 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:36204 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965313AbbLRB7F (ORCPT ); Thu, 17 Dec 2015 20:59:05 -0500 Date: Fri, 18 Dec 2015 07:29:00 +0530 From: Viresh Kumar To: Mans Rullgard Cc: Viresh Kumar , Andy Shevchenko , Dan Williams , Vinod Koul , 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: <20151218015900.GF28277@ubuntu> 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: 988 Lines: 26 On 17-12-15, 23:30, 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. > > Signed-off-by: Mans Rullgard > --- > This has only been compile-tested as I have no suitable hardware. > --- > drivers/dma/dw/platform.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) Acked-by: Viresh Kumar -- viresh -- 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/