浏览代码

i7core_edac: Call pci_dev_put() when alloc_i7core_dev() failed

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hidetoshi Seto 15 年之前
父节点
当前提交
2896637b86
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/edac/i7core_edac.c

+ 3 - 1
drivers/edac/i7core_edac.c

@@ -1384,8 +1384,10 @@ static int i7core_get_onedevice(struct pci_dev **prev,
 	i7core_dev = get_i7core_dev(socket);
 	if (!i7core_dev) {
 		i7core_dev = alloc_i7core_dev(socket, table);
-		if (!i7core_dev)
+		if (!i7core_dev) {
+			pci_dev_put(pdev);
 			return -ENOMEM;
+		}
 	}
 
 	if (i7core_dev->pdev[devno]) {