Page MenuHomeFreeBSD

LinuxKPI: device.h add devm_kmemdup()
ClosedPublic

Authored by bz on Sep 21 2022, 7:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 22, 6:07 AM
Unknown Object (File)
Sun, Sep 21, 10:06 PM
Unknown Object (File)
Aug 2 2025, 6:25 PM
Unknown Object (File)
Jul 27 2025, 6:34 AM
Unknown Object (File)
Jul 27 2025, 2:21 AM
Unknown Object (File)
Jul 26 2025, 7:22 PM
Unknown Object (File)
Jul 7 2025, 2:07 AM
Unknown Object (File)
Jul 7 2025, 1:59 AM
Subscribers

Details

Summary

Add devm_kmemdup() as needed by a networking driver.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Sep 21 2022, 7:38 PM
This revision is now accepted and ready to land.Sep 22 2022, 11:28 AM
emaste added inline comments.
sys/compat/linuxkpi/common/include/linux/device.h
612–613

From a quick look it seems len == 0 isn't allowed in Linux [but I think this is fine].

bz marked an inline comment as done.Sep 22 2022, 2:40 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/device.h
612–613

We could just let it run into the same check at the top of devm_kmalloc() -> lkpi_devres_alloc(). Just trying to void the work.

sys/compat/linuxkpi/common/include/linux/device.h
612–613

Yeah, I just mean that AFAICT Linux would crash with len == 0, and so it should never be called that way anyway.

I'm fine with or without the check.

bz marked 2 inline comments as done.Sep 22 2022, 3:02 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/device.h
612–613

Oh I see. Thanks for clarifying.

This revision was automatically updated to reflect the committed changes.
bz marked an inline comment as done.