浏览代码

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: 1c51b50c2995 ("PCI/MSI: Export MSI mode using attributes, not kobjects")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Dave Jones <davej@redhat.com>
Greg Kroah-Hartman 11 年之前
父节点
当前提交
13f81c099b
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/pci/msi.c

+ 1 - 0
drivers/pci/msi.c

@@ -595,6 +595,7 @@ error_attrs:
 		++count;
 		msi_attr = msi_attrs[count];
 	}
+	kfree(msi_attrs);
 	return ret;
 }