Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1020462ybe; Wed, 4 Sep 2019 11:14:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkMdfaxJZBQfeq3vEof+x3mrW0It378hw3GdonIl18t0StIC6QRQBVqNLO0U3D9R4ym5oZ X-Received: by 2002:a62:5343:: with SMTP id h64mr33356100pfb.4.1567620899869; Wed, 04 Sep 2019 11:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567620899; cv=none; d=google.com; s=arc-20160816; b=iazKWHsJFNNs/N0s8pJhqP0trfqdoIlz8h1Cv1KmbPpMa6FVb+i81w1yXlZIRfHwZA gvjIMrxKeAJCA+O4QOF/w/+SHmlBv5e/ebEt4a9tngoS9oSU6TrUVxDxF8+jRn54uIpg tdftbm3yOzxygDoRDcn41KaZf8vuYUuLzWBb9nQ2OfaN57lj706JR90W4wwXs6ryyFrj CMdXfu2A25T++YlhwwD7QEILnuHU1xyGOOjD5miQYNRL6ktVmpcp3vDmNlJETdbhY/f7 X8BvFDZmB+vh+y9TRh7p8PE+l5F1Oj38uT9wc1wcnS1g1mSym7JAbjOTildHUzKS+dWB I+mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FWTc1cafs57lotc+c+Sw3kTJpwAGtpnKxQP9a2UNcg8=; b=ppP4k5WU6CqE9BocokpGw9Rr8uYrDM5XuIL9udNO2iibbvdrn41BiMPMkqgokwPkcP dpdvxEdEhw4ayVYEEafFvCXW1Q94Q4/cRHI7jCbqPyk3KK3cg4eSH6mh5TCoLSVjE6o9 g+dMcslle/l1kK0WilkqTaD5knHMJjeLA2fKRJ6UzOso6no6Fqgt2FAqkopTKzEkpk8r 5crj/pqHq1WuWllqF7UWTVaoowWzRgMLWCA6y3agtQjrRoAC0ngbvu/TNrL9iQuk7vRp wlkXbCu1wvhvopaTJAvaBZlrsKx6OWOhiLhrxuYRTsO5a4tQDcBADldo4ca4dEmDuhzo 00fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yoqivbHf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 90si18762031ple.168.2019.09.04.11.14.44; Wed, 04 Sep 2019 11:14:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yoqivbHf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390032AbfIDSNX (ORCPT + 99 others); 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; }