Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'driver-core-6.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core fixes from Danilo Krummrich:

- Introduce DMA Rust helpers to avoid build errors when !CONFIG_HAS_DMA

- Remove unnecessary (and hence incorrect) endian conversion in the
Rust PCI driver sample code

- Fix memory leak in the unwind path of debugfs_change_name()

- Support non-const struct software_node pointers in
SOFTWARE_NODE_REFERENCE(), after introducing _Generic()

- Avoid NULL pointer dereference in the unwind path of
simple_xattrs_free()

* tag 'driver-core-6.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core:
fs/kernfs: null-ptr deref in simple_xattrs_free()
software node: Also support referencing non-constant software nodes
debugfs: Fix memleak in debugfs_change_name().
samples: rust: fix endianness issue in rust_driver_pci
rust: dma: add helpers for architectures without CONFIG_HAS_DMA

+32 -5
+5 -2
fs/debugfs/inode.c
··· 841 841 rd.new_parent = rd.old_parent; 842 842 rd.flags = RENAME_NOREPLACE; 843 843 target = lookup_noperm_unlocked(&QSTR(new_name), rd.new_parent); 844 - if (IS_ERR(target)) 845 - return PTR_ERR(target); 844 + if (IS_ERR(target)) { 845 + error = PTR_ERR(target); 846 + goto out_free; 847 + } 846 848 847 849 error = start_renaming_two_dentries(&rd, dentry, target); 848 850 if (error) { ··· 864 862 out: 865 863 dput(rd.old_parent); 866 864 dput(target); 865 + out_free: 867 866 kfree_const(new_name); 868 867 return error; 869 868 }
+4 -2
fs/kernfs/dir.c
··· 681 681 return kn; 682 682 683 683 err_out4: 684 - simple_xattrs_free(&kn->iattr->xattrs, NULL); 685 - kmem_cache_free(kernfs_iattrs_cache, kn->iattr); 684 + if (kn->iattr) { 685 + simple_xattrs_free(&kn->iattr->xattrs, NULL); 686 + kmem_cache_free(kernfs_iattrs_cache, kn->iattr); 687 + } 686 688 err_out3: 687 689 spin_lock(&root->kernfs_idr_lock); 688 690 idr_remove(&root->ino_idr, (u32)kernfs_ino(kn));
+1
include/linux/property.h
··· 371 371 (const struct software_node_ref_args) { \ 372 372 .swnode = _Generic(_ref_, \ 373 373 const struct software_node *: _ref_, \ 374 + struct software_node *: _ref_, \ 374 375 default: NULL), \ 375 376 .fwnode = _Generic(_ref_, \ 376 377 struct fwnode_handle *: _ref_, \
+21
rust/helpers/dma.c
··· 19 19 { 20 20 return dma_set_mask_and_coherent(dev, mask); 21 21 } 22 + 23 + int rust_helper_dma_set_mask(struct device *dev, u64 mask) 24 + { 25 + return dma_set_mask(dev, mask); 26 + } 27 + 28 + int rust_helper_dma_set_coherent_mask(struct device *dev, u64 mask) 29 + { 30 + return dma_set_coherent_mask(dev, mask); 31 + } 32 + 33 + int rust_helper_dma_map_sgtable(struct device *dev, struct sg_table *sgt, 34 + enum dma_data_direction dir, unsigned long attrs) 35 + { 36 + return dma_map_sgtable(dev, sgt, dir, attrs); 37 + } 38 + 39 + size_t rust_helper_dma_max_mapping_size(struct device *dev) 40 + { 41 + return dma_max_mapping_size(dev); 42 + }
+1 -1
samples/rust/rust_driver_pci.rs
··· 48 48 // Select the test. 49 49 bar.write8(index.0, Regs::TEST); 50 50 51 - let offset = u32::from_le(bar.read32(Regs::OFFSET)) as usize; 51 + let offset = bar.read32(Regs::OFFSET) as usize; 52 52 let data = bar.read8(Regs::DATA); 53 53 54 54 // Write `data` to `offset` to increase `count` by one.