From patchwork Sat Jun 7 03:02:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_Mart=C3=ADnez?= X-Patchwork-Id: 4315081 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B0A5BBEEAA for ; Sat, 7 Jun 2014 03:02:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC65D2020F for ; Sat, 7 Jun 2014 03:02:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 075BF20127 for ; Sat, 7 Jun 2014 03:02:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752674AbaFGDCA (ORCPT ); Fri, 6 Jun 2014 23:02:00 -0400 Received: from mail-ve0-f178.google.com ([209.85.128.178]:59986 "EHLO mail-ve0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbaFGDB7 (ORCPT ); Fri, 6 Jun 2014 23:01:59 -0400 Received: by mail-ve0-f178.google.com with SMTP id sa20so4265140veb.23 for ; Fri, 06 Jun 2014 20:01:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=nknelY3m3JLl5LGjs8C4wI5p4blOyqR6bpA04nPOCE4=; b=RegDP5lqVeK6b7ad20oJPNgmx4B9y1D2aqWVpBghjA7JKIxBrWa5l+F68RMJyj0tbp 7dXDNRNzeY2ysWZVzqEFO3gUZ/z3OEg2IEmer7yrlomqQfeFsho/40wCrDU2sb5cDVY7 RiQrq+LAE/hSKPobzopPwFBYbP76e4YPxHRR1C/jFDW3ZWoNYQmqTffGU+RmlB3FCMTe 1oWdZwQuXObmlHHnCkefVpt5cNh3O2JIjC4Z7sAB+1L3EmosyNfZIXm/Z/UkPCTAE05m kUgbixsmmxAeLmUy7roMhfLZznuo1sfskHpPXBV9SgZGn0ABMlIAp8mb7SrvgyVdw6V5 yQgg== X-Gm-Message-State: ALoCoQnppSngMD3tyyVI+NsjCRPMnnKj7PpdbewuQNG+gv2bQL46or5jxwsM9poRo2AtbjQ9sGaA X-Received: by 10.58.246.132 with SMTP id xw4mr10535886vec.2.1402110119309; Fri, 06 Jun 2014 20:01:59 -0700 (PDT) Received: from localhost (host18.190-30-94.telecom.net.ar. [190.30.94.18]) by mx.google.com with ESMTPSA id xg3sm21231840vdb.23.2014.06.06.20.01.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 20:01:58 -0700 (PDT) From: =?UTF-8?q?Guido=20Mart=C3=ADnez?= To: dri-devel@lists.freedesktop.org, linux-arm-kernel@vger.kernel.org, linux-omap@vger.kernel.org Cc: =?UTF-8?q?Ezequiel=20Garc=C3=ADa?= , David Airlie , Russell King , Rob Clark , Tony Lindgren , Daniel Mack , =?UTF-8?q?Guido=20Mart=C3=ADnez?= , stable@vger.kernel.org Subject: [PATCH 7/9] drm/tilcdc: fix double kfree Date: Sat, 7 Jun 2014 00:02:06 -0300 Message-Id: <1402110128-30471-8-git-send-email-guido@vanguardiasur.com.ar> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <1402110128-30471-1-git-send-email-guido@vanguardiasur.com.ar> References: <1402110128-30471-1-git-send-email-guido@vanguardiasur.com.ar> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP display_timings_release calls kfree on the display_timings object passed to it. Calling kfree after it is wrong. SLUB debug showed the following warning: ============================================================================= BUG kmalloc-64 (Tainted: G W ): Object already free ----------------------------------------------------------------------------- Disabling lock debugging due to kernel taint INFO: Allocated in of_get_display_timings+0x2c/0x214 age=601 cpu=0 pid=884 __slab_alloc.constprop.79+0x2e0/0x33c kmem_cache_alloc+0xac/0xdc of_get_display_timings+0x2c/0x214 panel_probe+0x7c/0x314 [tilcdc] platform_drv_probe+0x18/0x48 [..snip..] INFO: Freed in panel_destroy+0x18/0x3c [tilcdc] age=0 cpu=0 pid=907 __slab_free+0x34/0x330 panel_destroy+0x18/0x3c [tilcdc] tilcdc_unload+0xd0/0x118 [tilcdc] drm_dev_unregister+0x24/0x98 [..snip..] Signed-off-by: Guido Martínez Cc: stable@vger.kernel.org --- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 1943b2f..b085dcc 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -286,10 +286,8 @@ static void panel_destroy(struct tilcdc_module *mod) { struct panel_module *panel_mod = to_panel_module(mod); - if (panel_mod->timings) { + if (panel_mod->timings) display_timings_release(panel_mod->timings); - kfree(panel_mod->timings); - } tilcdc_module_cleanup(mod); kfree(panel_mod->info);