Define the error indicator $Z = \mathbf{1}_{X \neq Y}$, so $\mathbb{P}(Z=0) = 1-p$ and $\mathbb{P}(Z=1) = p$, giving $H(Z) = H(p)$. By the joint conditioning inequality,
\begin{align*}
H(X \mid Y) \leq H(p) + H(X \mid Y, Z). \tag{$*$}
\end{align*}
When $Z = 0$, we know $X = Y$, so $H(X \mid Y=y, Z=0) = 0$. When $Z=1$, there are at most $m-1$ remaining possibilities for $X$ (all values in $A$ except $Y$), so $H(X \mid Y=y, Z=1) \leq \log_2(m-1)$. Therefore
\begin{align*}
H(X \mid Y, Z) = \sum_{y,z} \mathbb{P}(Y=y, Z=z) H(X \mid Y=y, Z=z) \leq \mathbb{P}(Z=1) \log_2(m-1) = p \log_2(m-1).
\end{align*}
Substituting into $(*)$ gives the result.