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)
Sat, Oct 11, 11:17 PM
Unknown Object (File)
Sat, Oct 11, 4:52 PM
Unknown Object (File)
Sat, Oct 11, 8:17 AM
Unknown Object (File)
Sat, Oct 11, 8:16 AM
Unknown Object (File)
Sat, Oct 11, 8:16 AM
Unknown Object (File)
Sat, Oct 11, 8:16 AM
Unknown Object (File)
Sat, Oct 11, 12:56 AM
Unknown Object (File)
Sun, Oct 5, 1:41 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 Not Applicable
Unit
Tests Not Applicable