  It has been pointed out that hypermagnetic helicity decay at the electroweak
symmetry breaking may have produced the observed baryon asymmetry of the
Universe through the chiral anomaly in the standard model of particle physics.
Although fully helical magnetic field that can adequately produce the observed
baryon asymmetry is not strong enough to explain the origin of the
intergalactic magnetic field inferred by the Fermi satellite, the mixture of
helical and nonhelical primordial magnetic fields may explain both baryogenesis
and the intergalactic magnetic fields simultaneously. We first show that such a
scenario is ruled out by the constraint on the amplitude of baryon isocurvature
perturbations produced by the primordial magnetic fields to avoid
overproduction of deuterium at the big bang nucleosynthesis. Then we show that
any attempt to explain the origin of intergalactic magnetic field by primordial
magnetogenesis before the electroweak symmetry breaking does not work due to
the above constraint irrespective of the helicity and baryogenesis mechanism.
