diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-01-20 09:52:53 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-01-27 08:34:34 +0100 |
commit | dd3bca72c4db353080e3de44124d45712d73b4f4 (patch) | |
tree | 6997f1a8018add612dee064f958903a9075744b3 /drivers/media/pci/ivtv | |
parent | 0dfa73608f45918aa1c9a98c6d4c8b86382a4bc2 (diff) |
media: pci/ivtv: release memory regions on error
Fix this smatch warning:
drivers/media/pci/ivtv/ivtv-driver.c:900 ivtv_setup_pci() warn: 'itv->base_addr' not released on lines: 876.
One error path didn't release the memory regions.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/pci/ivtv')
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-driver.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index 28acb14490d5..6e448cb3b51c 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c @@ -873,6 +873,11 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev, pci_read_config_word(pdev, PCI_COMMAND, &cmd); if (!(cmd & PCI_COMMAND_MASTER)) { IVTV_ERR("Bus Mastering is not enabled\n"); + if (itv->has_cx23415) + release_mem_region(itv->base_addr + IVTV_DECODER_OFFSET, + IVTV_DECODER_SIZE); + release_mem_region(itv->base_addr, IVTV_ENCODER_SIZE); + release_mem_region(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); return -ENXIO; } } |