mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-06 10:49:18 -05:00
net/wan/fsl_ucc_hdlc: reject muram offsets above 64K
[ Upstream commit 148587a59f6b85831695e0497d9dd1af5f0495af ] Qiang Zhao points out that these offsets get written to 16-bit registers, and there are some QE platforms with more than 64K muram. So it is possible that qe_muram_alloc() gives us an allocation that can't actually be used by the hardware, so detect and reject that. Reported-by: Qiang Zhao <[email protected]> Reviewed-by: Timur Tabi <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]> Acked-by: David S. Miller <[email protected]> Signed-off-by: Li Yang <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
12ba455b1d
commit
53d9b08dc8
1 changed files with 5 additions and 0 deletions
|
|
@ -245,6 +245,11 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
|
|||
ret = -ENOMEM;
|
||||
goto free_riptr;
|
||||
}
|
||||
if (riptr != (u16)riptr || tiptr != (u16)tiptr) {
|
||||
dev_err(priv->dev, "MURAM allocation out of addressable range\n");
|
||||
ret = -ENOMEM;
|
||||
goto free_tiptr;
|
||||
}
|
||||
|
||||
/* Set RIPTR, TIPTR */
|
||||
iowrite16be(riptr, &priv->ucc_pram->riptr);
|
||||
|
|
|
|||
Loading…
Reference in a new issue