Skip to contentSkip to conversation

drivers/memstick/host/jmb38x_ms: fixes incorrect error handling

PATCH New Pan Bian 1 participant 1 message Nov 22, 2018 Sony memorystick

lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 drivers/memstick/host/jmb38x_ms: fixes incorrect error handling

kfree() is incorrectly used to free the memory chunk allocated by memstick_alloc_host(). Instead, memstick_free_host() should be used.

Fixes 60fdd931d577("memstick: add support for JMicron jmb38x ...")
---
 drivers/memstick/host/jmb38x_ms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memstick/host/jmb38x_ms.c +1 -1
index bcdca9f..637409c 100644
@@ -907,7 +907,7 @@ static struct memstick_host *jmb38x_ms_alloc_host(struct jmb38x_ms *jm, int cnt)
 
 	iounmap(host->addr);
 err_out_free:
-	kfree(msh);
+	memstick_free_host(msh);
 	return NULL;
 }
 
Signature · 1 line
2.7.4