From: Ben Skeggs Date: Tue, 26 Feb 2013 23:52:47 +0000 (+1000) Subject: drm/nouveau/i2c: drop parent refcount when creating ports X-Git-Tag: v3.9-rc2~15^2~7^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42bed34c364786b3757f9d788d8ed39120e8f1b5;p=profile%2Fcommon%2Fkernel-common.git 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 --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c index a114a0e..2e98e8a 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c +++ b/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 */ if (ret == 0) { list_add_tail(&port->head, &i2c->ports); + atomic_dec(&parent->refcount); atomic_dec(&engine->refcount); }