Skip to content
Commit 7cb43beb authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by David S. Miller
Browse files

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: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7da5ee09
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment