  A hypothetical photon mass, $m_\gamma$, gives an energy-dependent light speed
in a Lorentz-invariant theory. Such a modification causes an additional time
delay between photons of different energies when they travel through a fixed
distance. Fast radio bursts (FRBs), with their short time duration and
cosmological propagation distance, are excellent astrophysical objects to
constrain $m_\gamma$. Here for the first time we develop a Bayesian framework
to study this problem with a catalog of FRBs. Those FRBs with and without
redshift measurement are both useful in this framework, and can be combined in
a Bayesian way. A catalog of 21 FRBs (including 20 FRBs without redshift
measurement, and one, FRB 121102, with a measured redshift $z=0.19273 \pm
0.00008$) give a combined limit $m_\gamma \leq 8.7 \times 10^{-51}\, {\rm kg}$,
or equivalently $m_\gamma \leq 4.9 \times 10^{-15}\, {\rm eV}/c^2$ ($m_\gamma
\leq 1.5\times10^{-50} \, {\rm kg}$, or equivalently $m_\gamma \leq 8.4 \times
10^{-15} \,{\rm eV}/c^2$) at 68% (95%) confidence level, which represents the
best limit that comes purely from kinematics. The framework proposed here will
be valuable when FRBs are observed daily in the future. Increment in the number
of FRBs, and refinement in the knowledge about the electron distributions in
the Milky Way, the host galaxies of FRBs, and the intergalactic median, will
further tighten the constraint.
