Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3663216pxb; Mon, 24 Jan 2022 14:47:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxet+qEhUGK85U0Io83IqTXSEtYdYmCWJHyqtm+WEq/yn64xEVKzAc/1dx+ss6FOD6z3GFu X-Received: by 2002:a17:903:18b:b0:14b:36be:e5aa with SMTP id z11-20020a170903018b00b0014b36bee5aamr10034602plg.94.1643064439643; Mon, 24 Jan 2022 14:47:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643064439; cv=none; d=google.com; s=arc-20160816; b=SfBvfeHr4GNMbcEpK/CLsMAVy0QcAhae+AXJ3yUw4bDtPJT9JWn9rbfNxhhAMZop1i vKZe8EaBbFp07JZoQ0yeNtutzMe9s3ulKRHnDL2VipvTF871OHzNygsoJCgVe4v7ioMF gFrhlu811u6oBOXKTdpKUWuqz4pwMhM8Dap1T3862WnLlO9QruTqj1sU5HMuAqSohp0g OfKhgk8Tv/7xlwEysjJpgfCoOdQTInl6OTiCqJ5snTURT01Z5D0HfXH3Kj7zBeWRZVY/ 6UEz/IxkIjao7YdaSLPtAXSr+pnN2a3lx9dwESnrivRTQbz3dku+bY+wc0RUZwEHTyd2 1pQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=crZVynmorq99qRSGu42dM9IcooSqkHJxA0DZY5AOztE=; b=OdVGz3QN/Duw7AVZwNKojjuVqXp6j6b6XQS8L4advc2Bg3/sTYjJ5NIvS0krJ/DkSK UzyOQSoJ4gdRhJaYFfwqV012BSZ3JN/W2NQof5G5FidX+eiOFwvv3YcbkThwEcMxByJQ 91sW0HYmoYMMMizWAKmoUTbcAYdZEESSd6WCV/binRRdSSruBFwQUNlcIkQJrssITCzJ QjogYJsBQMzoitldapTqW2nNqAvFdqFdUQUolM+/c4Qo38vzAGH/iPGdV47E4Bp7EhP7 WaONOEjOHaI+opExgFJtQlu/d8idFJT7yamu6PSHNYQmz24mH6fpzFwb3RmrodP1xy4C orwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ETP9HeVs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si13162932pfb.209.2022.01.24.14.47.08; Mon, 24 Jan 2022 14:47:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ETP9HeVs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380562AbiAXWnl (ORCPT + 99 others); Mon, 24 Jan 2022 17:43:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1456655AbiAXVjo (ORCPT ); Mon, 24 Jan 2022 16:39:44 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CCF7C0419C3; Mon, 24 Jan 2022 12:26:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2C3E26150D; Mon, 24 Jan 2022 20:26:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D81CFC340E5; Mon, 24 Jan 2022 20:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055966; bh=tc4vaYi2tH8OU8FZACwACbNtaBA8r1yAdX/YVgAuQhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ETP9HeVs8rTCleDZCGBomDdY9s/QZooGRMPamvjGYjpVEOJ4sOgm7yfgDLxcskO5V bpKeZPwNLNphGQqIAjYyUXjgPINb7yGP6IdegO9IILNI0ci7iWr9uENEojXNFbwCJM iSO/RA9sSx6HrH6WN26VJLPaU7tdo6kbnkODE/U4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Sasha Levin Subject: [PATCH 5.15 324/846] usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe Date: Mon, 24 Jan 2022 19:37:21 +0100 Message-Id: <20220124184112.079280719@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit b52fe2dbb3e655eb1483000adfab68a219549e13 ] Since the acpi_create_platform_device() function may return error pointers, dwc3_qcom_create_urs_usb_platdev() function may return error pointers too. Using IS_ERR_OR_NULL() to check the return value to fix this. Fixes: c25c210f590e ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20211222111823.22887-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc3/dwc3-qcom.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 3cb01cdd02c29..b81a9e1c13153 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -769,9 +769,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev) if (qcom->acpi_pdata->is_urs) { qcom->urs_usb = dwc3_qcom_create_urs_usb_platdev(dev); - if (!qcom->urs_usb) { + if (IS_ERR_OR_NULL(qcom->urs_usb)) { dev_err(dev, "failed to create URS USB platdev\n"); - return -ENODEV; + if (!qcom->urs_usb) + return -ENODEV; + else + return PTR_ERR(qcom->urs_usb); } } } -- 2.34.1