On Wed, 5 Sep 2018 19:22:19 +0800, Ding Xiang <dingxiang@xxxxxxxxxxxxxxxxxxxx> wrote:
the memory allocated and ioremap address need free after...
device_register return error.
exit_put:This change will break exit_put error path.
put_device(&dev->dev);
- return;
+exit_free:
+ iounmap(dev->base);
+ kfree(dev);
I think kfree will be called from txx9_device_release by put_device.
Please refer James's comment on previous trial:
<https://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20180305221833.GJ4197%40saruman>