@@ -10501,7 +10501,7 @@ static int get_reachability_groups_log(int argc, char **argv, struct command *cm
1050110501}
1050210502
1050310503static int get_reachability_association_desc (struct nvme_dev * dev , struct nvme_get_log_args * args ,
10504- __u64 offset ,
10504+ __u64 * offset ,
1050510505 struct nvme_reachability_associations_log * * logp )
1050610506{
1050710507 int err ;
@@ -10511,11 +10511,11 @@ static int get_reachability_association_desc(struct nvme_dev *dev, struct nvme_g
1051110511
1051210512 for (i = 0 ; i < le16_to_cpu (log -> nrad ); i ++ ) {
1051310513 len = sizeof (* log -> rad );
10514- err = get_log_offset (dev , args , & offset , len , (void * * )& log );
10514+ err = get_log_offset (dev , args , offset , len , (void * * )& log );
1051510515 if (err )
1051610516 goto err_free ;
1051710517 len = le32_to_cpu (log -> rad [i ].nrid ) * sizeof (* log -> rad [i ].rgid );
10518- err = get_log_offset (dev , args , & offset , len , (void * * )& log );
10518+ err = get_log_offset (dev , args , offset , len , (void * * )& log );
1051910519 if (err )
1052010520 goto err_free ;
1052110521 }
@@ -10530,7 +10530,8 @@ static int get_reachability_association_desc(struct nvme_dev *dev, struct nvme_g
1053010530}
1053110531
1053210532static int get_reachability_associations (struct nvme_dev * dev , bool rao , bool rae ,
10533- struct nvme_reachability_associations_log * * logp )
10533+ struct nvme_reachability_associations_log * * logp ,
10534+ __u64 * lenp )
1053410535{
1053510536 int err ;
1053610537 struct nvme_reachability_associations_log * log ;
@@ -10553,11 +10554,12 @@ static int get_reachability_associations(struct nvme_dev *dev, bool rao, bool ra
1055310554 if (err )
1055410555 goto err_free ;
1055510556
10556- err = get_reachability_association_desc (dev , & args , log_len , & log );
10557+ err = get_reachability_association_desc (dev , & args , & log_len , & log );
1055710558 if (err )
1055810559 goto err_free ;
1055910560
1056010561 * logp = log ;
10562+ * lenp = log_len ;
1056110563 return 0 ;
1056210564
1056310565err_free :
@@ -10572,6 +10574,7 @@ static int get_reachability_associations_log(int argc, char **argv, struct comma
1057210574 const char * rao = "Return Associations Only" ;
1057310575 nvme_print_flags_t flags ;
1057410576 int err ;
10577+ __u64 len = 0 ;
1057510578
1057610579 _cleanup_free_ struct nvme_reachability_associations_log * log = NULL ;
1057710580
@@ -10601,9 +10604,9 @@ static int get_reachability_associations_log(int argc, char **argv, struct comma
1060110604 return err ;
1060210605 }
1060310606
10604- err = get_reachability_associations (dev , cfg .rao , cfg .rae , & log );
10607+ err = get_reachability_associations (dev , cfg .rao , cfg .rae , & log , & len );
1060510608 if (!err )
10606- nvme_show_reachability_associations_log (log , flags );
10609+ nvme_show_reachability_associations_log (log , len , flags );
1060710610 else if (err > 0 )
1060810611 nvme_show_status (err );
1060910612 else
0 commit comments