diff options
author | Dongliang Mu <[email protected]> | 2023-03-16 21:32:36 +0800 |
---|---|---|
committer | Kalle Valo <[email protected]> | 2023-05-27 11:30:31 +0300 |
commit | 072210c725c4938682e58236eeeb19a2ddd0b817 (patch) | |
tree | 1916ab0f10f424fc5f632dbbca46768313ea8660 | |
parent | daef020558bc34e8031263aa7cf9e803d709f93a (diff) |
wifi: ray_cs: add sanity check on local->sram/rmem/amem
The ray_config uses ray_release as its unified error handling function.
However, it does not know if local->sram/rmem/amem succeeds or not.
Fix this by adding sanity check on local->sram/rmem/amem in the
ray_relase.
Signed-off-by: Dongliang Mu <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
-rw-r--r-- | drivers/net/wireless/legacy/ray_cs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/legacy/ray_cs.c b/drivers/net/wireless/legacy/ray_cs.c index 93eaf3dba6a9..4b53a9c70e7e 100644 --- a/drivers/net/wireless/legacy/ray_cs.c +++ b/drivers/net/wireless/legacy/ray_cs.c @@ -738,9 +738,12 @@ static void ray_release(struct pcmcia_device *link) del_timer_sync(&local->timer); - iounmap(local->sram); - iounmap(local->rmem); - iounmap(local->amem); + if (local->sram) + iounmap(local->sram); + if (local->rmem) + iounmap(local->rmem); + if (local->amem) + iounmap(local->amem); pcmcia_disable_device(link); dev_dbg(&link->dev, "ray_release ending\n"); |