From patchwork Fri Nov 6 03:31:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qing Wang X-Patchwork-Id: 321888 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54271C4742C for ; Fri, 6 Nov 2020 03:31:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01CF02078B for ; Fri, 6 Nov 2020 03:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725950AbgKFDb3 (ORCPT ); Thu, 5 Nov 2020 22:31:29 -0500 Received: from m176115.mail.qiye.163.com ([59.111.176.115]:19401 "EHLO m176115.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbgKFDb3 (ORCPT ); Thu, 5 Nov 2020 22:31:29 -0500 Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.231]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id AD9BB666934; Fri, 6 Nov 2020 11:31:23 +0800 (CST) From: Wang Qing To: Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] usb: Use IS_ERR_OR_NULL() instead of IS_ERR() Date: Fri, 6 Nov 2020 11:31:18 +0800 Message-Id: <1604633478-24729-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZHxgeSB4fHhhJQx8ZVkpNS09NSEhPQ09KQ0pVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OCo6PBw6ND8qKx0XSSs8OkpD ARkwCzBVSlVKTUtPTUhIT0NPTkJKVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlISllXWQgBWUFKTk5ONwY+ X-HM-Tid: 0a759b9bda699373kuwsad9bb666934 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org __usb_find_phy may return NULL, so we should use IS_ERR_OR_NULL() Signed-off-by: Wang Qing --- drivers/usb/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index de21967..60c5ea4 100755 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -460,7 +460,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) spin_lock_irqsave(&phy_lock, flags); phy = __usb_find_phy(&phy_list, type); - if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { + if (IS_ERR_OR_NULL(phy) || !try_module_get(phy->dev->driver->owner)) { pr_debug("PHY: unable to find transceiver of type %s\n", usb_phy_type_string(type)); if (!IS_ERR(phy))