Skip to content

Commit 019117e

Browse files
calebsanderigaw
authored andcommitted
ioctl: avoid sending uninitialized timestamp
The last 2 bytes of the struct nvme_timestamp data are not initialized in nvme_set_features_timestamp(). Add an initializer to avoid sending uninitialized stack memory to the controller. Signed-off-by: Caleb Sander <[email protected]>
1 parent 7fcee0a commit 019117e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/nvme/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ int nvme_set_features_auto_pst(int fd, bool apste, bool save,
685685
int nvme_set_features_timestamp(int fd, bool save, __u64 timestamp)
686686
{
687687
__le64 t = cpu_to_le64(timestamp);
688-
struct nvme_timestamp ts;
688+
struct nvme_timestamp ts = {};
689689
struct nvme_set_features_args args = {
690690
.args_size = sizeof(args),
691691
.fd = fd,

0 commit comments

Comments
 (0)