diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index a5ee21319d37fa2633bd5625099fb429a5c353ca..3535ef896677a28dcc352654c880587e9bc463c2 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -117,8 +117,10 @@ static struct pktcdvd_kobj* pkt_kobj_create(struct pktcdvd_device *pd, p->kobj.parent = parent; p->kobj.ktype = ktype; p->pd = pd; - if (kobject_register(&p->kobj) != 0) + if (kobject_register(&p->kobj) != 0) { + kobject_put(&p->kobj); return NULL; + } return p; } /*