Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752732AbbDZUGb (ORCPT ); Sun, 26 Apr 2015 16:06:31 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:47199 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751748AbbDZUG3 (ORCPT ); Sun, 26 Apr 2015 16:06:29 -0400 Date: Sun, 26 Apr 2015 16:06:27 -0400 (EDT) Message-Id: <20150426.160627.2170240613916324389.davem@davemloft.net> To: khoroshilov@ispras.ru Cc: antoine.tenart@free-electrons.com, arnd@arndb.de, sebastian.hesselbarth@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH] pxa168: fix double deallocation of managed resources From: David Miller In-Reply-To: <1429924023-11543-1-git-send-email-khoroshilov@ispras.ru> References: <1429924023-11543-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: Mew version 6.6 on Emacs 24.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 26 Apr 2015 13:06:29 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1146 Lines: 27 From: Alexey Khoroshilov Date: Sat, 25 Apr 2015 04:07:03 +0300 > Commit 43d3ddf87a57 ("net: pxa168_eth: add device tree support") starts > to use managed resources by adding devm_clk_get() and > devm_ioremap_resource(), but it leaves explicit iounmap() and clock_put() > in pxa168_eth_remove() and in failure handling code of pxa168_eth_probe(). > As a result double free can happen. > > The patch removes explicit resource deallocation. Also it converts > clk_disable() to clk_disable_unprepare() to make it symmetrical with > clk_prepare_enable(). > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Alexey Khoroshilov Applied and queued up for -stable, thanks. I find this patch _extremely_ amusing, as it shows that that these managed interfaces can be just as error prone to use as the non-managed ones. :-) -- 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/