]> git.baikalelectronics.ru Git - kernel.git/commit
wan: lmc: Switch to using managed resources
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Sat, 27 Feb 2016 17:04:16 +0000 (22:34 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Mar 2016 18:43:03 +0000 (13:43 -0500)
commit48686d1d894d035799935b416a34cdab8ecaa87f
tree8505f9c1aa22ac79376877fd5f5378b10f48847b
parent2f6cb34748c24ea58713f159154a220df867afad
wan: lmc: Switch to using managed resources

Use managed resource functions devm_kzalloc and pcim_enable_device
to simplify error handling. Subsequently, remove unnecessary
kfree, pci_disable_device and pci_release_regions.

To be compatible with the change, various gotos are replaced with
direct returns and unneeded labels are dropped.

Also, `sc` was only being freed in the probe function and not the
remove function before the change. By using devm_kzalloc this patch
also fixes this memory leak.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/lmc/lmc_main.c