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)
May 17 2024, 3:58 PM
Unknown Object (File)
May 8 2024, 11:21 AM
Unknown Object (File)
May 8 2024, 11:10 AM
Unknown Object (File)
May 8 2024, 11:10 AM
Unknown Object (File)
May 8 2024, 9:05 AM
Unknown Object (File)
Jan 12 2024, 9:11 AM
Unknown Object (File)
Jan 10 2024, 2:02 AM
Unknown Object (File)
Nov 7 2023, 11:42 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.