From patchwork Mon Jun 13 23:31:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 9174703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D1F216044F for ; Mon, 13 Jun 2016 23:32:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C34C920410 for ; Mon, 13 Jun 2016 23:32:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B807B27BC3; Mon, 13 Jun 2016 23:32:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1D8B420410 for ; Mon, 13 Jun 2016 23:32:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCbLD-0005q7-Ot; Mon, 13 Jun 2016 23:32:23 +0000 Received: from m12-11.163.com ([220.181.12.11]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCbL3-0005fw-Eu; Mon, 13 Jun 2016 23:32:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=yR08Q SxKAqzekk7yI3pV6bbvIM3RSLzHnaZo0BbhvtU=; b=IxgSoRf2VIXX0GZJO8yIZ TqNsdUNqy7v5mrpdZzM0WRcJpyt0xMaHugjqX0UPmd/HhhP0OACtMcAp+ysY27Tn 2u1b+Wu8xQlW5GmrSTaFf2WMqw12g1ZVcuctIjzZNpm8axvSA3jssGySWHbW10kl 9MrR7XKsGnsL3jY6YE1XrM= Received: from localhost.localdomain.localdomain (unknown [180.102.102.213]) by smtp7 (Coremail) with SMTP id C8CowACHhV5jQl9XVAAyAA--.22466S3; Tue, 14 Jun 2016 07:31:49 +0800 (CST) From: weiyj_lk@163.com To: Kishon Vijay Abraham I , Heiko Stuebner Subject: [PATCH] phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe() Date: Mon, 13 Jun 2016 23:31:47 +0000 Message-Id: <1465860707-26005-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-CM-TRANSID: C8CowACHhV5jQl9XVAAyAA--.22466S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4kZr1rZrWUGw4kXFWUArb_yoW3CFg_C3 yrZrnrXr4ktF1FgryUGFy3u3sIy3Wqgr4ruFnaya4aya4DK34Fqr95Zws8JFnrWwsxJFZx Cw1qvr1xCryxJjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUn4q2tUUUUU== X-Originating-IP: [180.102.102.213] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiRwWH1lc63zFEwAAAsU X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160613_163213_853071_1ED75723 X-CRM114-Status: UNSURE ( 6.73 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, Wei Yongjun , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function devm_kzalloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Reviewed-by: Heiko Stuebner --- drivers/phy/phy-rockchip-dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-rockchip-dp.c b/drivers/phy/phy-rockchip-dp.c index 793ecb6..8b267a7 100644 --- a/drivers/phy/phy-rockchip-dp.c +++ b/drivers/phy/phy-rockchip-dp.c @@ -90,7 +90,7 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev) return -ENODEV; dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL); - if (IS_ERR(dp)) + if (!dp) return -ENOMEM; dp->dev = dev;