Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f8439db authored by Sungjun Park's avatar Sungjun Park Committed by Gerrit - the friendly Code Review server
Browse files

bluetooth: Fix free data pointer routine



Data pointer has been reused after freed it. So,
it has been moved to after using the data pointer
to clean up resource and freed it.

Change-Id: Ibc94e092134ff1f36e896c679ade7f639254a24d
Signed-off-by: default avatarSungjun Park <sjpark@codeaurora.org>
parent edc93d8c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -509,7 +509,6 @@ static int btfm_slim_remove(struct slim_device *slim)
	BTFMSLIM_DBG("");
	mutex_destroy(&btfm_slim->io_lock);
	mutex_destroy(&btfm_slim->xfer_lock);
	kfree(btfm_slim);
	snd_soc_unregister_codec(&slim->dev);

	BTFMSLIM_DBG("slim_remove_device() - btfm_slim->slim_ifd");
@@ -517,6 +516,8 @@ static int btfm_slim_remove(struct slim_device *slim)

	BTFMSLIM_DBG("slim_remove_device() - btfm_slim->slim_pgd");
	slim_remove_device(slim);

	kfree(btfm_slim);
	return 0;
}