Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S972223AbdDYEWH (ORCPT ); Tue, 25 Apr 2017 00:22:07 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37582 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S940068AbdDYEV7 (ORCPT ); Tue, 25 Apr 2017 00:21:59 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0F9AD61322 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vivek.gautam@codeaurora.org Subject: Re: [PATCH -next] phy: qcom-qmp: fix return value check in qcom_qmp_phy_create() To: Wei Yongjun , Kishon Vijay Abraham I References: <20170425031454.11564-1-weiyj.lk@gmail.com> Cc: Wei Yongjun , linux-kernel@vger.kernel.org From: Vivek Gautam Message-ID: <1665c641-f8e2-ca14-279b-e49732fcc09c@codeaurora.org> Date: Tue, 25 Apr 2017 09:51:54 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20170425031454.11564-1-weiyj.lk@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1498 Lines: 50 On 04/25/2017 08:44 AM, Wei Yongjun wrote: > From: Wei Yongjun > > In case of error, the function of_iomap() returns NULL pointer > not ERR_PTR(). The IS_ERR() test in the return value check should > be replaced with NULL test. > > Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") > Signed-off-by: Wei Yongjun Reviewed-by: Vivek Gautam > --- > drivers/phy/phy-qcom-qmp.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/phy/phy-qcom-qmp.c b/drivers/phy/phy-qcom-qmp.c > index 727e23b..a25c29d 100644 > --- a/drivers/phy/phy-qcom-qmp.c > +++ b/drivers/phy/phy-qcom-qmp.c > @@ -983,16 +983,16 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id) > * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2. > */ > qphy->tx = of_iomap(np, 0); > - if (IS_ERR(qphy->tx)) > - return PTR_ERR(qphy->tx); > + if (!qphy->tx) > + return -ENOMEM; > > qphy->rx = of_iomap(np, 1); > - if (IS_ERR(qphy->rx)) > - return PTR_ERR(qphy->rx); > + if (!qphy->rx) > + return -ENOMEM; > > qphy->pcs = of_iomap(np, 2); > - if (IS_ERR(qphy->pcs)) > - return PTR_ERR(qphy->pcs); > + if (!qphy->pcs) > + return -ENOMEM; > > /* > * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3 > -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project