From 975b4bbc754aec5a5a745e9bddaa438b0f3a4449 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Sun, 13 Nov 2011 09:41:15 +0200 Subject: [PATCH] --- yaml --- r: 280971 b: refs/heads/master c: 6f37aca827e6d075c9e9d3ab1b233cce2a3bc9f1 h: refs/heads/master i: 280969: ff7f5aaabfdc778f2f959c1e92540a11c8b18546 280967: 629d1d136b0f01239e2ad7f889b496d26c6efd21 v: v3 --- [refs] | 2 +- trunk/drivers/staging/mei/main.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 2dad9c2213ab..a3ad1810880f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5b881e3c08a8041604bd60117cca22e1ff026e9b +refs/heads/master: 6f37aca827e6d075c9e9d3ab1b233cce2a3bc9f1 diff --git a/trunk/drivers/staging/mei/main.c b/trunk/drivers/staging/mei/main.c index 410b5d46b150..1ea04b31f611 100644 --- a/trunk/drivers/staging/mei/main.c +++ b/trunk/drivers/staging/mei/main.c @@ -228,8 +228,9 @@ static struct mei_cl_cb *find_read_list_entry( static int mei_open(struct inode *inode, struct file *file) { struct mei_cl *cl; - int err; struct mei_device *dev; + unsigned long cl_id; + int err; err = -ENODEV; if (!mei_device) @@ -255,14 +256,16 @@ static int mei_open(struct inode *inode, struct file *file) if (dev->open_handle_count >= MEI_MAX_OPEN_HANDLE_COUNT) goto out_unlock; - cl->host_client_id = find_first_zero_bit(dev->host_clients_map, - MEI_CLIENTS_MAX); - if (cl->host_client_id > MEI_CLIENTS_MAX) + cl_id = find_first_zero_bit(dev->host_clients_map, MEI_CLIENTS_MAX); + if (cl_id >= MEI_CLIENTS_MAX) goto out_unlock; + cl->host_client_id = cl_id; + dev_dbg(&dev->pdev->dev, "client_id = %d\n", cl->host_client_id); dev->open_handle_count++; + list_add_tail(&cl->link, &dev->file_list); set_bit(cl->host_client_id, dev->host_clients_map);