Page MenuHomeFreeBSD

nvmecontrol wdc: Don't pass a bogus pointer to free().
ClosedPublic

Authored by jhb on Sep 29 2022, 10:39 PM.
Tags
None
Referenced Files
F108084648: D36827.id111247.diff
Tue, Jan 21, 6:10 AM
F108070462: D36827.diff
Tue, Jan 21, 3:25 AM
Unknown Object (File)
Sun, Jan 19, 3:36 AM
Unknown Object (File)
Fri, Jan 17, 11:28 PM
Unknown Object (File)
Dec 14 2024, 2:14 AM
Unknown Object (File)
Oct 9 2024, 12:04 PM
Unknown Object (File)
Oct 4 2024, 3:20 AM
Unknown Object (File)
Oct 4 2024, 3:17 AM
Subscribers

Details

Summary

wdc_get_dui_log_size allocates a buffer and then advances the
returned pointer. Passing this advanced pointer to free() is UB,
so save the original pointer to pass to free() instead.

Reported by: GCC 12 -Wfree-nonheap-object

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 47641
Build 44528: arc lint + arc unit