From 32c0146f51c85be51abf428919e0cea7ee601524 Mon Sep 17 00:00:00 2001 From: Vasily Averin Date: Sun, 5 Mar 2006 23:18:14 +0100 Subject: [PATCH] --- yaml --- r: 22583 b: refs/heads/master c: 071a651e28bfc1a66a885dc285792e335427a097 h: refs/heads/master i: 22581: a45dc1026113a32f9fa690bbe34fddbe65293a4a 22579: ed56f4b43a17367e0fc8457b9949d8334c30e5bf 22575: c99a52aa76323139cdd83baff9bea5d7c76cf52f v: v3 --- [refs] | 2 +- trunk/drivers/message/i2o/exec-osm.c | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 59bfea316ade..557ec8223d59 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cf7f5b45fe0180a0f0e3491183c0ec95e4b96d44 +refs/heads/master: 071a651e28bfc1a66a885dc285792e335427a097 diff --git a/trunk/drivers/message/i2o/exec-osm.c b/trunk/drivers/message/i2o/exec-osm.c index 9bb9859f6dfe..5ea133c59afb 100644 --- a/trunk/drivers/message/i2o/exec-osm.c +++ b/trunk/drivers/message/i2o/exec-osm.c @@ -57,6 +57,13 @@ struct i2o_exec_wait { struct list_head list; /* node in global wait list */ }; +/* Work struct needed to handle LCT NOTIFY replies */ +struct i2o_exec_lct_notify_work { + struct work_struct work; /* work struct */ + struct i2o_controller *c; /* controller on which the LCT NOTIFY + was received */ +}; + /* Exec OSM class handling definition */ static struct i2o_class_id i2o_exec_class_id[] = { {I2O_CLASS_EXECUTIVE}, @@ -355,9 +362,12 @@ static int i2o_exec_remove(struct device *dev) * new LCT and if the buffer for the LCT was to small sends a LCT NOTIFY * again, otherwise send LCT NOTIFY to get informed on next LCT change. */ -static void i2o_exec_lct_modified(struct i2o_controller *c) +static void i2o_exec_lct_modified(struct i2o_exec_lct_notify_work *work) { u32 change_ind = 0; + struct i2o_controller *c = work->c; + + kfree(work); if (i2o_device_parse_lct(c) != -EAGAIN) change_ind = c->lct->change_ind + 1; @@ -410,7 +420,7 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, return i2o_msg_post_wait_complete(c, m, msg, context); if ((le32_to_cpu(msg->u.head[1]) >> 24) == I2O_CMD_LCT_NOTIFY) { - struct work_struct *work; + struct i2o_exec_lct_notify_work *work; pr_debug("%s: LCT notify received\n", c->name); @@ -418,8 +428,11 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, if (!work) return -ENOMEM; - INIT_WORK(work, (void (*)(void *))i2o_exec_lct_modified, c); - queue_work(i2o_exec_driver.event_queue, work); + work->c = c; + + INIT_WORK(&work->work, (void (*)(void *))i2o_exec_lct_modified, + work); + queue_work(i2o_exec_driver.event_queue, &work->work); return 1; }