diff options
author | Fabio M. De Francesco <fmdefrancesco@gmail.com> | 2022-04-02 20:56:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-04 08:33:49 +0300 |
commit | aaec586a3ca5d24ed67faee54f7a54d3e6ac1107 (patch) | |
tree | 114c225c5114c1435a0ac197b45781493b5095b3 /drivers/staging/sm750fb | |
parent | c9736770e6c30295dfd1802dde87b7f727d699f7 (diff) | |
download | linux-aaec586a3ca5d24ed67faee54f7a54d3e6ac1107.tar.xz |
staging: sm750fb: Call iounmap() to free mapped bus memory
If ioremap_wc() fails, the code jumps to the "exit" label and forgets to
free the bus memory mapped into "sm750_dev->pvReg". Mapped bus memory must
always be freed by calling iounmap().
Call iounmap(sm750_dev->pvReg) when the above-mentioned failures happen.
The site of the missing iounmap() has been detected by Smatch.
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20220402175655.31512-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm750fb')
-rw-r--r-- | drivers/staging/sm750fb/sm750_hw.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index a7c6eb07b62e..55cb00e8b0d1 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -81,6 +81,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev) sm750_dev->pvMem = ioremap_wc(sm750_dev->vidmem_start, sm750_dev->vidmem_size); if (!sm750_dev->pvMem) { + iounmap(sm750_dev->pvReg); pr_err("Map video memory failed\n"); ret = -EFAULT; goto exit; |