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)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 12 Oct 2021 08:24:39 +0000 (10:24 +0200)
commitbeae4a6258e64af609ad5995cc6b6056eb0d898e
tree2d73580742c0e86e6206112b367aed90971927d5
parent8105c2abbf36296bf38ca44f55ee45d160db476a
memstick: jmb38x_ms: use appropriate free function in jmb38x_ms_alloc_host()

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>
drivers/memstick/host/jmb38x_ms.c