From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A2B3C3A5A8 for ; Wed, 4 Sep 2019 18:13:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B0752087E for ; Wed, 4 Sep 2019 18:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620804; bh=drb7sK90yHJ9RrZ7N8+0cRl2hmmn/pSTZtOmQSedxYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=m5YAYh2aOiowbN14mDbF7HT2HMG6heWelRBM5jTdI9zR71jX6V2LzqLfAcMVtidZw BJWGVMH2zJo/r0pAdjPhYQcbfDHwmK911bdQmEjFeln6Zz6NjQ8bCsQjnYz5cyLR25 iqiGlb+SLiNgBCmn9gEjw9qmX90AmTbxe9f2SBlU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390675AbfIDSNX (ORCPT ); Wed, 4 Sep 2019 14:13:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:58176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390669AbfIDSNV (ORCPT ); Wed, 4 Sep 2019 14:13:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A63B9206BA; Wed, 4 Sep 2019 18:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620801; bh=drb7sK90yHJ9RrZ7N8+0cRl2hmmn/pSTZtOmQSedxYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yoqivbHfFBHK/ZSwNNPJYD+ftgZi4VGLFqCXhR5tAR/4kfjrVaiHUYRhB3HMI59al qP1MmZtDUH+CVbowKiZ9wgHhJzjfqs6X4hlA+lSmHSilx5ilOHF/KBtIsPfjk/pAZX OIToejYv7CIO0vUpaMAXMpWfT+0ISqY19CcV8wMg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ding Xiang , Alexander Shishkin Subject: [PATCH 5.2 098/143] stm class: Fix a double free of stm_source_device Date: Wed, 4 Sep 2019 19:54:01 +0200 Message-Id: <20190904175318.076051059@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ding Xiang commit 961b6ffe0e2c403b09a8efe4a2e986b3c415391a upstream. In the error path of stm_source_register_device(), the kfree is unnecessary, as the put_device() before it ends up calling stm_source_device_release() to free stm_source_device, leading to a double free at the outer kfree() call. Remove it. Signed-off-by: Ding Xiang Signed-off-by: Alexander Shishkin Fixes: 7bd1d4093c2fa ("stm class: Introduce an abstraction for System Trace Module devices") Link: https://lore.kernel.org/linux-arm-kernel/1563354988-23826-1-git-send-email-dingxiang@cmss.chinamobile.com/ Cc: stable@vger.kernel.org # v4.4+ Link: https://lore.kernel.org/r/20190821074955.3925-2-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/hwtracing/stm/core.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -1276,7 +1276,6 @@ int stm_source_register_device(struct de err: put_device(&src->dev); - kfree(src); return err; }