]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 27 Apr 2020 12:29:22 +0000 (12:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:56 +0000 (17:48 +0200)
[ Upstream commit 652b7b6740eb52d98377a881c7730e36997f00ab ]

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Fixes: 6ac7e4d7ad70 ("mfd: wcd934x: Add support to wcd9340/wcd9341 codec")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/wcd934x.c

index 90341f3c68101e47452d5a1a69e69ff3d2b40612..da910302d51a2c107bb6db5586d2071f4739262e 100644 (file)
@@ -280,7 +280,6 @@ static void wcd934x_slim_remove(struct slim_device *sdev)
 
        regulator_bulk_disable(WCD934X_MAX_SUPPLY, ddata->supplies);
        mfd_remove_devices(&sdev->dev);
-       kfree(ddata);
 }
 
 static const struct slim_device_id wcd934x_slim_id[] = {