Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1012848ybe; Wed, 4 Sep 2019 11:08:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlWXLfUN561Jgqpjs5Z10m4H4xC47W4pbhQT3LrnT6Doxq3cs6CNyJ3m/LpDY4oH4TkiAB X-Received: by 2002:a65:6497:: with SMTP id e23mr34830464pgv.89.1567620493797; Wed, 04 Sep 2019 11:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567620493; cv=none; d=google.com; s=arc-20160816; b=z97s5f2buCosF5WOevDTOEaJojPt4AQf+dwC8gxVVIsUI4hgYhgSi3/qqalq11YBzV A9d6W+qEbanYSxD8zH/h3iVntmahjeTVy6w5Vhx6385SiJ+SG8ARDPohkPj6Bq8er8SK Q8+bSPOqGEioeV2uK2KeLTvQvxPUkXwN9+4COHfxAPavAPyZRSsyNcjc+yo2rK8M0pWq 27v/tKnJiuDtx0h2pXpDXRViwLFMQ4vSFZZ4yuQbeyi8wcuU3rZeH2jggcWyNOweGbQt WRKEWi+84Twki+bcYpoZcWPoVfuuqzx7tMyhjXTTDR+9wiFi56OAmA3HoeLZMB4LYeiU llnw== 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=0WLiCU2sJv1sNOmxbiUHRaicBrY2oN+hSiEjfSqGDbI=; b=e1DLTx7pbvm8Y9JIGamyYIQpL94EdZQbBdxYThQTThFxEgeW+9JqCaMxjsmHMgIMUI 765W4hioSJmVTbjMbecsCQNdcU7fmTxp47jPWaImiHtCRiURe8EeVIOH08+e1+tIogWo cS7brX6ezA/qwREh2phjFHiVYUM7kVNfLAH8/kfy69ukOctj0yS7tjJCcvpnWwH/OEIw IqNZzI6kQY80d/XKiw5GYfDzM7ZsvG6APPdA8pzN+Bg53CIunxK+GM6RnzU8tNyngdG8 275efaH99oCiQOphY7VM+i7A0rclpNLx32rmP8x0tpb1cwxwYMMI4fZ3xBg2NO4DmOXK Uh+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F2tKM7zz; 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 n10si17969670plk.433.2019.09.04.11.07.57; Wed, 04 Sep 2019 11:08:13 -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=F2tKM7zz; 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 S2389197AbfIDSFH (ORCPT + 99 others); Wed, 4 Sep 2019 14:05:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:46308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388825AbfIDSFD (ORCPT ); Wed, 4 Sep 2019 14:05:03 -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 EA3DB2339E; Wed, 4 Sep 2019 18:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620302; bh=r3hHmwvr5gwac8HXyAhPmaX+ldpvoyfb/3IuCoowTQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F2tKM7zzkfFH62XT+jTK9hLNfNbkDTTVa/kg8HeGKsQ+xTiGtr15thAfrL1zRHurC DAZ8mUCKf+OJXAf6mXKnBZcwFkfibf3K0paxLgH3o75nmgSVe9/RrLPNfghiC6Ks7h g/8i5B2pq61ezBJsyWzFOFyw+vJoPMqVm27Cnu70= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ding Xiang , Alexander Shishkin Subject: [PATCH 4.14 41/57] stm class: Fix a double free of stm_source_device Date: Wed, 4 Sep 2019 19:54:09 +0200 Message-Id: <20190904175306.005214863@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175301.777414715@linuxfoundation.org> References: <20190904175301.777414715@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 @@ -1107,7 +1107,6 @@ int stm_source_register_device(struct de err: put_device(&src->dev); - kfree(src); return err; }