Browse Source

staging: slicoss: fix dma memory leak

This patch fixes a memory leak in slic_card_init. If the driver fails
to poll for an interrupt after requesting config data from the device
the dma memory is never freed.

Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack 11 years ago
parent
commit
9bc97445a3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/staging/slicoss/slicoss.c

+ 3 - 0
drivers/staging/slicoss/slicoss.c

@@ -2851,6 +2851,9 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 						&slic_regs->slic_isp, 0,
 						&slic_regs->slic_isp, 0,
 						&slic_regs->slic_addr_upper,
 						&slic_regs->slic_addr_upper,
 						0, FLUSH);
 						0, FLUSH);
+					pci_free_consistent(adapter->pcidev,
+						sizeof(struct slic_eeprom),
+						peeprom, phys_config);
 					return -EINVAL;
 					return -EINVAL;
 				}
 				}
 			}
 			}