staging: slicoss: fix dma memory leak
authorDavid Matlack <dmatlack@google.com>
Tue, 6 May 2014 04:02:35 +0000 (21:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 11:08:34 +0000 (20:08 +0900)
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>
drivers/staging/slicoss/slicoss.c

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