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
Unknown Object (File)
Tue, May 26, 8:05 AM
Unknown Object (File)
Tue, May 26, 8:01 AM
Unknown Object (File)
Mon, May 25, 11:29 PM
Unknown Object (File)
Mon, May 25, 11:24 PM
Unknown Object (File)
Thu, May 21, 5:04 PM
Unknown Object (File)
Mon, May 18, 2:19 AM
Unknown Object (File)
Mon, May 18, 2:13 AM
Unknown Object (File)
Sat, May 16, 3:08 PM
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