In this paper, we present closed form expressions that jointly optimizes the fusion rule (m) and the number of secondary users (K) for the m-out-of-K rule by minimizing the Bayes risk at the fusion center (FC) in the presence of erroneous reporting channels and then show that various existing and new results are special cases of the proposed solution. The results are applicable to any detector used in cooperative spectrum sensing (CSS). Numerical results are presented using energy detector (ED) which shows that CSS obtained using joint optimized values of m and K results in significant performance improvement. © 2018 VDE VERLAG GMBH.