A primary design goal of the cell-free~(CF) massive MIMO architecture is to provide uniformly good coverage to all the user equipments~(UEs) connected to the network. However, it has been found that this requirement may not be satisfied in case the channels between the access points~(APs) and the UEs are mixed LoS/NLoS. In this paper, we try to address this issue via the use of appropriate power control in both the uplink and downlink of a CF massive MIMO system under mixed LoS/NLoS channels. We find that simplistic power control techniques, such as channel inversion-based power control perform sub-optimally as compared to max-min power control. As a consequence, we propose a particle swarm algorithm~(PSA) based power control algorithm to optimize the performance of the system under study. We then use numerical simulations to evaluate the performance of the proposed PSA-based solution and show that it results in a significant improvement in the fairness of the underlying system while incurring a lower computational complexity.