search for: list_for_each_entry_safe_reverse

Displaying 5 results from an estimated 5 matches for "list_for_each_entry_safe_reverse".

2017 Dec 12
1
[PATCHv2] virtio_mmio: fix devm cleanup
...ogether with the memory, since alloc_dr() does: size_t tot_size = sizeof(struct devres) + size; struct devres *dr; dr = kmalloc_node_track_caller(tot_size, gfp, nid); return dr->data; ... where dr->data points at the memory after the struct devres. Later, in release_nodes() we do: list_for_each_entry_safe_reverse(dr, tmp, &todo, node.entry) { devres_log(dev, &dr->node, "REL"); dr->node.release(dev, dr->data); kfree(dr); } ... which will invoke the no-op devm_kmalloc_release, then free the devres allocation, including the dr->data memory the user requested. > so...
2017 Dec 12
1
[PATCHv2] virtio_mmio: fix devm cleanup
...ogether with the memory, since alloc_dr() does: size_t tot_size = sizeof(struct devres) + size; struct devres *dr; dr = kmalloc_node_track_caller(tot_size, gfp, nid); return dr->data; ... where dr->data points at the memory after the struct devres. Later, in release_nodes() we do: list_for_each_entry_safe_reverse(dr, tmp, &todo, node.entry) { devres_log(dev, &dr->node, "REL"); dr->node.release(dev, dr->data); kfree(dr); } ... which will invoke the no-op devm_kmalloc_release, then free the devres allocation, including the dr->data memory the user requested. > so...
2020 Jul 16
0
[PATCH vhost next 09/10] vdpa/mlx5: Add shared memory registration code
...426 { 427 struct mlx5_vdpa_mr *mr = &mvdev->mr; 428 struct mlx5_vdpa_direct_mr *dmr; 429 struct mlx5_vdpa_direct_mr *n; 430 431 mutex_lock(&mr->mkey_mtx); 432 if (!mr->initialized) 433 goto out; 434 435 destroy_indirect_key(mvdev, mr); 436 list_for_each_entry_safe_reverse(dmr, n, &mr->head, list) { 437 list_del_init(&dmr->list); 438 unmap_direct_mr(mvdev, dmr); 439 kfree(dmr); 440 } 441 memset(mr, 0, sizeof(*mr)); 442 mr->initialized = false; 443 out: 444 mutex_unlock(&mr->mkey_mtx); 445 } 446 --- 0-D...
2017 Dec 12
4
[PATCHv2] virtio_mmio: fix devm cleanup
Recent rework of the virtio_mmio probe/remove paths balanced a devm_ioremap() with an iounmap() rather than its devm variant. This ends up corrupting the devm datastructures, and results in the following boot-time splat on arm64 under QEMU 2.9.0: [ 3.450397] ------------[ cut here ]------------ [ 3.453822] Trying to vfree() nonexistent vm area (00000000c05b4844) [ 3.460534] WARNING: CPU:
2017 Dec 12
4
[PATCHv2] virtio_mmio: fix devm cleanup
Recent rework of the virtio_mmio probe/remove paths balanced a devm_ioremap() with an iounmap() rather than its devm variant. This ends up corrupting the devm datastructures, and results in the following boot-time splat on arm64 under QEMU 2.9.0: [ 3.450397] ------------[ cut here ]------------ [ 3.453822] Trying to vfree() nonexistent vm area (00000000c05b4844) [ 3.460534] WARNING: CPU: