Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df1deb67532ea26f1a033a5f48bf34b30bec8e1d Commit: df1deb67532ea26f1a033a5f48bf34b30bec8e1d Parent: 1005f66fd7175916db013dc98ca6b7cec26e5f81 Author: Julia Lawall <[EMAIL PROTECTED]> AuthorDate: Wed Nov 28 11:58:56 2007 +0100 Committer: Jaroslav Kysela <[EMAIL PROTECTED]> CommitDate: Thu Jan 31 17:29:30 2008 +0100
[ALSA] sound/core/memalloc.c: Add missing pci_dev_put There should be a pci_dev_put when breaking out of a loop that iterates over calls to pci_get_device and similar functions. In this case, the return under the initial if needs a pci_dev_put in the same way that the return under the subsequent for loop has a pci_dev_put. This was fixed using the following semantic patch. // <smpl> @@ type T; identifier d; expression e; @@ T *d; ... while ((d = \(pci_get_device\|pci_get_device_reverse\|pci_get_subsys\|pci_get_class\)(..., d)) != NULL) {... when != pci_dev_put(d) when != e = d ( return d; | + pci_dev_put(d); ? return ...; ) ...} // </smpl> Signed-off-by: Julia Lawall <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]> Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]> --- sound/core/memalloc.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 9b4992e..920e578 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -568,6 +568,7 @@ static ssize_t snd_mem_proc_write(struct file *file, const char __user * buffer, if (pci_set_dma_mask(pci, mask) < 0 || pci_set_consistent_dma_mask(pci, mask) < 0) { printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", mask, vendor, device); + pci_dev_put(pci); return count; } } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html