On 3 October 2013 22:13, Larry Finger <Larry.Finger@xxxxxxxxxxxx> wrote:diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
index ffcb10a..0c73a45 100644
--- a/drivers/memstick/core/memstick.c
+++ b/drivers/memstick/core/memstick.c
@@ -415,6 +415,7 @@ static struct memstick_dev *memstick_alloc_card(struct memstick_host *host)
return card;
err_out:
host->card = old_card;
+ kfree(card->dev.kobj.name);
It looks weird to go into dev.kobj internals here for freeing the
name. There is also memstick_free_card() which doesn't seem to do
anything about the name freeing.
Should memstick_alloc_card() do a device_initialise(&card->dev) and in
memstick_free_card() (or the error path) do a put_device(&card->dev)?
This should take care of kobj.name as well via kobject_put().