We study the linear stability of three-layer Hele-Shaw flow, which models the secondary oil recovery by polymer flooding, in the presence of a diffusion process and a variable viscosity in the middle layer (denoted by M.L.). Then the hydrodynamic stability of the flow is related with the advection-diffusion equation of the species. The diffusion coefficient and the viscosity in M.L. are used as parameters for minimizing the Saffman-Taylor instability. This model was studied also by Daripa and Paşa (Transp Porous Med 70(1):11-23, 2007). A particular basic solution was considered. The stabilizing effect of diffusion was proved, by using a variational formulation of the stability system. However, this analytical method was not giving sufficient conditions for improving the stability; the obtained upper bound of the growth constant (in time) of the perturbations was depending on the eigenfunctions of the stability system. In this paper, we improve the above result. We use a discretization method and obtain a classical algebraic eigenvalue problem, equivalent with the Sturm-Liouville system which governs the flow stability. A generalization of the Gerschgorin's localization theorem is given and two estimates of the growth constant are obtained, not depending on the eigenfunctions. The new estimates are used to obtain sufficient conditions for improving the stability. These conditions are given in terms of the viscosity profile, the diffusion coefficient, the injection velocity, and the M.L. length. We conclude that a strong diffusion process improves the stability in the range of large wavenumbers. In the range of small wavenumbers, a stability improvement is obtained if the viscosity jump on the M.L.-oil interface is small enough and the length of M.L. is large enough.