]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
memstick: jmb38x_ms: use appropriate free function in jmb38x_ms_alloc_host()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 11 Oct 2021 12:39:12 +0000 (15:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:36:09 +0000 (11:36 +0100)
commit3339c3bf3d779cc9de21bd9501d08ac651b22dc1
tree66420f800be99d7282534575b595043efda21902
parentd9c74d3fe297a9b056e1fe6a60c78578296cdb0e
memstick: jmb38x_ms: use appropriate free function in jmb38x_ms_alloc_host()

[ Upstream commit beae4a6258e64af609ad5995cc6b6056eb0d898e ]

The "msh" pointer is device managed, meaning that memstick_alloc_host()
calls device_initialize() on it.  That means that it can't be free
using kfree() but must instead be freed with memstick_free_host().
Otherwise it leads to a tiny memory leak of device resources.

Fixes: 60fdd931d577 ("memstick: add support for JMicron jmb38x MemoryStick host controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211011123912.GD15188@kili
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memstick/host/jmb38x_ms.c