@@ -124,7 +124,7 @@ int nvme_fw_download_seq(int fd, __u32 size, __u32 xfer, __u32 offset,
124124
125125int nvme_get_telemetry_max (int fd , enum nvme_telemetry_da * da , size_t * data_tx )
126126{
127- _cleanup_free_ struct nvme_id_ctrl * id_ctrl ;
127+ _cleanup_free_ struct nvme_id_ctrl * id_ctrl = NULL ;
128128 int err ;
129129
130130 id_ctrl = __nvme_alloc (sizeof (* id_ctrl ));
@@ -385,7 +385,7 @@ int nvme_namespace_detach_ctrls(int fd, __u32 nsid, __u16 num_ctrls,
385385
386386int nvme_get_ana_log_len (int fd , size_t * analen )
387387{
388- _cleanup_free_ struct nvme_id_ctrl * ctrl ;
388+ _cleanup_free_ struct nvme_id_ctrl * ctrl = NULL ;
389389 int ret ;
390390
391391 ctrl = __nvme_alloc (sizeof (* ctrl ));
@@ -405,7 +405,7 @@ int nvme_get_ana_log_len(int fd, size_t *analen)
405405
406406int nvme_get_logical_block_size (int fd , __u32 nsid , int * blksize )
407407{
408- _cleanup_free_ struct nvme_id_ns * ns ;
408+ _cleanup_free_ struct nvme_id_ns * ns = NULL ;
409409 __u8 flbas ;
410410 int ret ;
411411
@@ -426,7 +426,7 @@ int nvme_get_logical_block_size(int fd, __u32 nsid, int *blksize)
426426
427427static int __nvme_set_attr (const char * path , const char * value )
428428{
429- _cleanup_fd_ int fd ;
429+ _cleanup_fd_ int fd = -1 ;
430430
431431 fd = open (path , O_WRONLY );
432432 if (fd < 0 ) {
0 commit comments