]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
wdc: Fix use-after-free access of cbs_data
authorJeff Lien <jeff.lien@wdc.com>
Mon, 14 Feb 2022 22:32:19 +0000 (16:32 -0600)
committerDaniel Wagner <dwagner@suse.de>
Wed, 16 Feb 2022 07:53:04 +0000 (08:53 +0100)
commite84916182a8938c541da2ddefd53760af532b882
tree389872437401ed9eae1f1cdc32e45bc4c3de29d3
parent7b50ac27f4bc0a1f3a265625990daffc8bcc4633
wdc: Fix use-after-free access of cbs_data

Fix incorrect access after memory is already freed up. Also couple
of minor fixes to use correct cpu endianness while accessing data
read from drive.

Create a new function wdc_get_fw_cust_id that will simplfy the code
and handle the free of the allocated data

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
Co-Authored-by: Indraneel-M
[dwagner: updated commit message and merged everything into one patch]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
plugins/wdc/wdc-nvme.c