From patchwork Tue Jun 17 14:17:09 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: 4366391 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 28618BEEAA for ; Tue, 17 Jun 2014 14:16:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F772201BC for ; Tue, 17 Jun 2014 14:16:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19F8A202F2 for ; Tue, 17 Jun 2014 14:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933015AbaFQOQf (ORCPT ); Tue, 17 Jun 2014 10:16:35 -0400 Received: from mail-yk0-f171.google.com ([209.85.160.171]:36042 "EHLO mail-yk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933012AbaFQOQd (ORCPT ); Tue, 17 Jun 2014 10:16:33 -0400 Received: by mail-yk0-f171.google.com with SMTP id 200so5277345ykr.2 for ; Tue, 17 Jun 2014 07:16:33 -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=H3X94+AjTnbWAa5FuHixLHyXmDeBS93TVyybmHwXAnM=; b=emCXBOFltVvsxIaHJHRKURbj/fidqA0Wny/NtzsbJlBOqzSFplEQ8Tavmapqv+i9Lw wP4q4UES1FLDtNULA9icwpSuEn3A3EHHCmvpWgXwn5iUzpxEtz2MqQ+poDqZwKLpefvG qD4efCGOsnhF22l7v9YBVvbx3ZPpWP+EOhEYi5wMcbqA0ufooCYKxzKlBzZlPzZLwQu5 qScFzjDBgSXGGGqVsmd+csLsqvP4S6Ah89dEQgql2xJqfnIyv2Bd5dZNjzvmFq7PKLT9 ZSg0QqxkW2Ivo67zd7cpMYfOnKNZxtssdYGFbYkGeYDYM3Y7P58xM0oqyuRz1gOLqDiJ pR0Q== X-Gm-Message-State: ALoCoQlCN7VvMWRxJGLppWgE10kA9p26z1r5B0L5siq/Bhkszl5g5l8UW65kqHoN0/w6PcXTU+U5 X-Received: by 10.236.55.199 with SMTP id k47mr4284605yhc.128.1403014593258; Tue, 17 Jun 2014 07:16:33 -0700 (PDT) Received: from localhost (host18.190-30-94.telecom.net.ar. [190.30.94.18]) by mx.google.com with ESMTPSA id h13sm26034239yhd.35.2014.06.17.07.16.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jun 2014 07:16:32 -0700 (PDT) From: =?UTF-8?q?Guido=20Mart=C3=ADnez?= To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Cc: robdclark@gmail.com, =?UTF-8?q?Ezequiel=20Garc=C3=ADa?= , airlied@linux.ie, Daniel Mack , Russell King , Daniel Vetter , =?UTF-8?q?Guido=20Mart=C3=ADnez?= , Subject: [PATCH/RESEND 7/9] drm/tilcdc: fix double kfree Date: Tue, 17 Jun 2014 11:17:09 -0300 Message-Id: <1403014631-18072-8-git-send-email-guido@vanguardiasur.com.ar> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403014631-18072-1-git-send-email-guido@vanguardiasur.com.ar> References: <1402110128-30471-1-git-send-email-guido@vanguardiasur.com.ar> <1403014631-18072-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.9 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: #v3.9+ --- 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);