Skip to content

Commit

Permalink
wifi: ray_cs: add sanity check on local->sram/rmem/amem
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
mudongliang authored and Kalle Valo committed May 27, 2023
1 parent daef020 commit 072210c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/net/wireless/legacy/ray_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 072210c

Please sign in to comment.