public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
	Ding Xiang <dingxiang@cmss.chinamobile.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	stable@vger.kernel.org
Subject: [GIT PULL 1/4] stm class: Fix a double free of stm_source_device
Date: Tue, 20 Aug 2019 13:16:50 +0300	[thread overview]
Message-ID: <20190820101653.74738-2-alexander.shishkin@linux.intel.com> (raw)
In-Reply-To: <20190820101653.74738-1-alexander.shishkin@linux.intel.com>

From: Ding Xiang <dingxiang@cmss.chinamobile.com>

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 <dingxiang@cmss.chinamobile.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
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+
---
 drivers/hwtracing/stm/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index e55b902560de..181e7ff1ec4f 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -1276,7 +1276,6 @@ int stm_source_register_device(struct device *parent,
 
 err:
 	put_device(&src->dev);
-	kfree(src);
 
 	return err;
 }
-- 
2.23.0.rc1


  reply	other threads:[~2019-08-20 10:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 10:16 [GIT PULL 0/4] stm class/intel_th: Fixes for v5.3 Alexander Shishkin
2019-08-20 10:16 ` Alexander Shishkin [this message]
2019-08-20 10:16 ` [GIT PULL 2/4] intel_th: Use the correct style for SPDX License Identifier Alexander Shishkin
2019-08-20 10:16 ` [GIT PULL 3/4] intel_th: pci: Add support for another Lewisburg PCH Alexander Shishkin
2019-08-20 11:44   ` Greg Kroah-Hartman
2019-08-20 15:14     ` Alexander Shishkin
2019-08-20 10:16 ` [GIT PULL 4/4] intel_th: pci: Add Tiger Lake support Alexander Shishkin
2019-08-20 11:44   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190820101653.74738-2-alexander.shishkin@linux.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=dingxiang@cmss.chinamobile.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox