b43: N-PHY: handle allocation fail in samples generation
[safe/jmp/linux-2.6] / drivers / connector / cn_queue.c
index 408c2af..210338e 100644 (file)
@@ -78,16 +78,20 @@ void cn_queue_wrapper(struct work_struct *work)
        struct cn_callback_entry *cbq =
                container_of(work, struct cn_callback_entry, work);
        struct cn_callback_data *d = &cbq->data;
+       struct cn_msg *msg = NLMSG_DATA(nlmsg_hdr(d->skb));
+       struct netlink_skb_parms *nsp = &NETLINK_CB(d->skb);
 
-       d->callback(d->callback_priv);
+       d->callback(msg, nsp);
 
-       d->destruct_data(d->ddata);
-       d->ddata = NULL;
+       kfree_skb(d->skb);
+       d->skb = NULL;
 
        kfree(d->free);
 }
 
-static struct cn_callback_entry *cn_queue_alloc_callback_entry(char *name, struct cb_id *id, void (*callback)(void *))
+static struct cn_callback_entry *
+cn_queue_alloc_callback_entry(char *name, struct cb_id *id,
+                             void (*callback)(struct cn_msg *, struct netlink_skb_parms *))
 {
        struct cn_callback_entry *cbq;
 
@@ -120,7 +124,8 @@ int cn_cb_equal(struct cb_id *i1, struct cb_id *i2)
        return ((i1->idx == i2->idx) && (i1->val == i2->val));
 }
 
-int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *))
+int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id,
+                         void (*callback)(struct cn_msg *, struct netlink_skb_parms *))
 {
        struct cn_callback_entry *cbq, *__cbq;
        int found = 0;