6. For any real number $m$, the tangent line to the graph of the function
$$
f(x)=x^{2}+m x+1
$$

at the point $(2, f(2))$ always passes through a fixed point $P$. Then the coordinates of $P$ are ( ).
(A) $(0,3)$
(B) $(0,-3)$
(C) $\left(\frac{3}{2}, 0\right)$
(D) $\left(-\frac{3}{2}, 0\right)$
6. B.

Since $f^{\prime}(x)=2 x+m$, we have
$$
f^{\prime}(2)=4+m \text{. }
$$

Therefore, the equation of the tangent line at $(2, f(2))$ is
$$
y-(5+2 m)=(4+m)(x-2),
$$

which simplifies to $y=(m+4) x-3$.
Thus, the tangent line always passes through $(0,-3)$.