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)
Sat, Nov 2, 8:28 PM
Unknown Object (File)
Thu, Oct 24, 11:56 PM
Unknown Object (File)
Thu, Oct 24, 11:56 PM
Unknown Object (File)
Thu, Oct 24, 11:55 PM
Unknown Object (File)
Thu, Oct 24, 11:35 PM
Unknown Object (File)
Sep 30 2024, 3:30 PM
Unknown Object (File)
Sep 21 2024, 3:16 PM
Unknown Object (File)
Sep 21 2024, 3:16 PM
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.