瀏覽代碼

drm/nouveau/i2c: drop parent refcount when creating ports

Fixes issue where i2c subdev never gets destroyed due to its subobjects
holding references.  This will mean the i2c subdev refcount goes
negative during its destruction, but this isn't an issue in practice.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs 12 年之前
父節點
當前提交
42bed34c36
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/gpu/drm/nouveau/core/subdev/i2c/base.c

+ 1 - 0
drivers/gpu/drm/nouveau/core/subdev/i2c/base.c

@@ -142,6 +142,7 @@ nouveau_i2c_port_create_(struct nouveau_object *parent,
 	/* drop port's i2c subdev refcount, i2c handles this itself */
 	/* drop port's i2c subdev refcount, i2c handles this itself */
 	if (ret == 0) {
 	if (ret == 0) {
 		list_add_tail(&port->head, &i2c->ports);
 		list_add_tail(&port->head, &i2c->ports);
+		atomic_dec(&parent->refcount);
 		atomic_dec(&engine->refcount);
 		atomic_dec(&engine->refcount);
 	}
 	}