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, Aug 10, 10:41 AM
Unknown Object (File)
Mon, Aug 10, 10:25 AM
Unknown Object (File)
Mon, Aug 10, 9:59 AM
Unknown Object (File)
Thu, Aug 6, 6:20 PM
Unknown Object (File)
Tue, Aug 4, 8:23 AM
Unknown Object (File)
Tue, Aug 4, 3:21 AM
Unknown Object (File)
Mon, Aug 3, 6:32 AM
Unknown Object (File)
Jun 28 2026, 1:33 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.