mei: add mei_me_cl_by_uuid_id function

When handling dynamic clients there might be a race
scenario in which two me clients with the same me
address would be linked in the me clients list,
therefore we need to search by both uuid and me address.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
这个提交包含在:
Tomas Winkler
2014-08-21 14:29:15 +03:00
提交者 Greg Kroah-Hartman
父节点 25ca6472b5
当前提交 d880f3294d
修改 8 个文件,包含 26 行新增9 行删除

查看文件

@@ -147,7 +147,7 @@ static struct mei_cl *mei_bus_find_mei_cl_by_uuid(struct mei_device *dev,
struct mei_cl *cl;
list_for_each_entry(cl, &dev->device_list, device_link) {
if (!uuid_le_cmp(uuid, cl->device_uuid))
if (!uuid_le_cmp(uuid, cl->cl_uuid))
return cl;
}
@@ -242,7 +242,7 @@ static int ___mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length,
return -ENODEV;
/* Check if we have an ME client device */
me_cl = mei_me_cl_by_id(dev, cl->me_client_id);
me_cl = mei_me_cl_by_uuid_id(dev, &cl->cl_uuid, cl->me_client_id);
if (!me_cl)
return -ENOTTY;