public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG]is there a refcount leak in function mei_me_cl_rm_by_uuid?
@ 2020-05-06 14:46 亿一
  2020-05-07 18:50 ` Winkler, Tomas
  0 siblings, 1 reply; 2+ messages in thread
From: 亿一 @ 2020-05-06 14:46 UTC (permalink / raw)
  To: tomas.winkler; +Cc: linux-kernel

HI, all
When reviewing function mei_me_cl_rm_by_uuid, I notice that function
__mei_me_cl_by_uuid increases me_cl refcount
and function _mei_me_cl_del delete a list node with decrement me_cl
refcount , actually here cause a refcount leak as we haven't release
the refcount
by __mei_me_cl_by_uuid  ?
similar issue happens in mei_me_cl_rm_by_uuid_id too.

void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid)
{
    struct mei_me_client *me_cl;

    dev_dbg(dev->dev, "remove %pUl\n", uuid);

    down_write(&dev->me_clients_rwsem);
    me_cl = __mei_me_cl_by_uuid(dev, uuid); /* increase a refcount */
    __mei_me_cl_del(dev, me_cl); /* release the refcount with a list
node deteled */
    up_write(&dev->me_clients_rwsem);
}

Best regards,

Lin Yi.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-07 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-06 14:46 [BUG]is there a refcount leak in function mei_me_cl_rm_by_uuid? 亿一
2020-05-07 18:50 ` Winkler, Tomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox