Skip to content

Commit 41fe79c

Browse files
Dan Carpentergregkh
authored andcommitted
memstick: jmb38x_ms: use appropriate free function in jmb38x_ms_alloc_host()
[ Upstream commit beae4a6 ] 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: 60fdd93 ("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>
1 parent 4756d7f commit 41fe79c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/memstick/host/jmb38x_ms.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ static struct memstick_host *jmb38x_ms_alloc_host(struct jmb38x_ms *jm, int cnt)
882882

883883
iounmap(host->addr);
884884
err_out_free:
885-
kfree(msh);
885+
memstick_free_host(msh);
886886
return NULL;
887887
}
888888

0 commit comments

Comments
 (0)