Skip to content

Commit

Permalink
[CONNECTOR]: Don't touch queue dev after decrement of ref count.
Browse files Browse the repository at this point in the history
cn_queue_free_callback() will touch 'dev'(i.e. cbq->pdev), so it
should be called before atomic_dec(&dev->refcnt).

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li Zefan authored and David S. Miller committed Jan 9, 2008
1 parent 9d3e444 commit cf585ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/connector/cn_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id
spin_unlock_bh(&dev->queue_lock);

if (found) {
atomic_dec(&dev->refcnt);
cn_queue_free_callback(cbq);
atomic_dec(&dev->refcnt);
return -EINVAL;
}

Expand Down

0 comments on commit cf585ae

Please sign in to comment.