Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2502277imm; Mon, 24 Sep 2018 05:33:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZMyQo9rEcye52TEq/ukeqA3uJP2cO/iDl0+FEDrKHVWjsqKx/7NM58cQNT8MMt4/Kq4oh8 X-Received: by 2002:a62:9683:: with SMTP id s3-v6mr10274905pfk.191.1537792419268; Mon, 24 Sep 2018 05:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792419; cv=none; d=google.com; s=arc-20160816; b=zHZcUH1/g+9o/cWKxJc3I1SjL33KuWlwFSN7ZXs3C05tBVHQcMX3mYYjtSfAYDwvZ9 gZYR9YTZt1h80xZcvf+CUgxFodtFGoZiZ2CU6XdKWW1STUB+zYalI8AyiYZOGyo3ddXN /4Jdlm5TRvnEMZXgIV+GYH4nJyZXw6wk5kzRnU0T1aO2vVm9dJJRNCehHVXsAiert8E5 2RrQYJ5XR9rxWDVGJDaK9CCX0EtymJApql8bQvV6n/0EXKZKQHCqbLOBpNVi5PWyWv+o OuKkvsLsfp2hmIkJlDjR60aNVx9Ct0o0T1LNHd7Wh6Tve/vodHO2UVa2XZD0bzFmiPnQ QsXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=gUL+6VHHi2cl4WstO/d1/uFJUUSpw4CX6pqinRAYz7Y=; b=RThqbf5Q04gv/AVAIK1zMT8bi9yzE+ppzXgYrM7kBGbZUgG/EJyIeGvL4r64KHR/pH 87epTBuE10yMyx6YzaMcQXjhCk8+IqMyLfPPoY+Xjv60Tt6lHIaCaGtPmJ4lw8dmQqJy 3uN9dYkeeZjZgMrSZcnbhK5dWoULNUh+XSI/dCRFZMCy2Z0S1SENnE68dUSi2mJs9p7j QR16L6PcQ4Dz2huhQUPGYymxd/P+6R4IJnZzMwES1lAJi9681/OJSkEaawvHJxH8p50V 8AAnSSkfvjHzmQdMKQwNkYNJP0323Bp0R3bCwe63VsaEVvnDIBmfVjOJb0HfV4ESfgUe Barg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21-v6si35167678pgg.588.2018.09.24.05.33.23; Mon, 24 Sep 2018 05:33:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387976AbeIXSdE (ORCPT + 99 others); Mon, 24 Sep 2018 14:33:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57924 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730258AbeIXSdE (ORCPT ); Mon, 24 Sep 2018 14:33:04 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4ED5D1098; Mon, 24 Sep 2018 12:31:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YueHaibing , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 072/235] wan/fsl_ucc_hdlc: use IS_ERR_VALUE() to check return value of qe_muram_alloc Date: Mon, 24 Sep 2018 13:50:58 +0200 Message-Id: <20180924113112.436435833@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: YueHaibing [ Upstream commit fd800f646402c0f85547166b59ca065175928b7b ] qe_muram_alloc return a unsigned long integer,which should not compared with zero. check it using IS_ERR_VALUE() to fix this. Fixes: c19b6d246a35 ("drivers/net: support hdlc function for QE-UCC") Signed-off-by: YueHaibing Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wan/fsl_ucc_hdlc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -192,7 +192,7 @@ static int uhdlc_init(struct ucc_hdlc_pr priv->ucc_pram_offset = qe_muram_alloc(sizeof(struct ucc_hdlc_param), 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"); ret = -ENOMEM; goto free_tx_bd; @@ -230,14 +230,14 @@ static int uhdlc_init(struct ucc_hdlc_pr /* Alloc riptr, tiptr */ 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"); ret = -ENOMEM; goto free_tx_skbuff; } 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"); ret = -ENOMEM; goto free_riptr;