Commit fd800f64 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

wan/fsl_ucc_hdlc: use IS_ERR_VALUE() to check return value of qe_muram_alloc

qe_muram_alloc return a unsigned long integer,which should not
compared with zero. check it using IS_ERR_VALUE() to fix this.

Fixes: c19b6d24 ("drivers/net: support hdlc function for QE-UCC")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a525818
...@@ -192,7 +192,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) ...@@ -192,7 +192,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
priv->ucc_pram_offset = qe_muram_alloc(sizeof(struct ucc_hdlc_param), priv->ucc_pram_offset = qe_muram_alloc(sizeof(struct ucc_hdlc_param),
ALIGNMENT_OF_UCC_HDLC_PRAM); ALIGNMENT_OF_UCC_HDLC_PRAM);
if (priv->ucc_pram_offset < 0) { if (IS_ERR_VALUE(priv->ucc_pram_offset)) {
dev_err(priv->dev, "Can not allocate MURAM for hdlc parameter.\n"); dev_err(priv->dev, "Can not allocate MURAM for hdlc parameter.\n");
ret = -ENOMEM; ret = -ENOMEM;
goto free_tx_bd; goto free_tx_bd;
...@@ -230,14 +230,14 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) ...@@ -230,14 +230,14 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
/* Alloc riptr, tiptr */ /* Alloc riptr, tiptr */
riptr = qe_muram_alloc(32, 32); riptr = qe_muram_alloc(32, 32);
if (riptr < 0) { if (IS_ERR_VALUE(riptr)) {
dev_err(priv->dev, "Cannot allocate MURAM mem for Receive internal temp data pointer\n"); dev_err(priv->dev, "Cannot allocate MURAM mem for Receive internal temp data pointer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto free_tx_skbuff; goto free_tx_skbuff;
} }
tiptr = qe_muram_alloc(32, 32); tiptr = qe_muram_alloc(32, 32);
if (tiptr < 0) { if (IS_ERR_VALUE(tiptr)) {
dev_err(priv->dev, "Cannot allocate MURAM mem for Transmit internal temp data pointer\n"); dev_err(priv->dev, "Cannot allocate MURAM mem for Transmit internal temp data pointer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto free_riptr; goto free_riptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment