提交 29237756 编写于 作者: G Greg Kroah-Hartman 提交者: Bjorn Helgaas

PCI/MSI: Fix leak of msi_attrs

Coverity reported that I forgot to clean up some allocated memory on the
error path in populate_msi_sysfs(), so this patch fixes that.

Thanks to Dave Jones for pointing out where the error was, I obviously
can't read code this morning...

Found by Coverity (CID 1163317).

Fixes: 1c51b50c ("PCI/MSI: Export MSI mode using attributes, not kobjects")
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Cc: Dave Jones <davej@redhat.com>
上级 86bb4f69
......@@ -595,6 +595,7 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
++count;
msi_attr = msi_attrs[count];
}
kfree(msi_attrs);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册