Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3702442pxb; Mon, 24 Jan 2022 15:48:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlU0cea3o2Hejnoh38xWsIUiKWvjGgPcxAlqL8S+639nr4wWHSmlOZ1ApoKJRn3Fkq/eRj X-Received: by 2002:a62:800b:0:b0:4c8:fab7:2b02 with SMTP id j11-20020a62800b000000b004c8fab72b02mr7668371pfd.80.1643068114311; Mon, 24 Jan 2022 15:48:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068114; cv=none; d=google.com; s=arc-20160816; b=hNctA9kHNpYSi5nzMFdTFEI/K9KZOJFRHWYc4xsvRqFyaeDoy2hTCIzWSHG9NPr5YR xHwwHU+wx/W8kZ7b8hvUXU1YD3cjCFl303cfZDrn9Kd4LcqgxChMAzvVuV8+HM5zEFRZ SxEAUOZa25DiTWScq6qEletqhDGAdpyeG1GoVpl9Nx6dwuC1+1YARTH/BTSquW+PxQtj kcTDQ/lmjhF0y9hjdsG1HX8xTvrWZka+/TkqltqUq1k6WTjWTtNoTOubbuJmDT+2MqwP E7FuIPGKfLGsLtg1YJPwwmO3y7h1cns+QZJtSVt9Bcy61Ykl5mu8I61YU/+AAUG29o5z 9DAg== 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=Scv6RZ1nRLOhvtCB5duy36d6Fkm0qSORvoHGxj609UnDi/zzszBcGamegP5Re9aOAa KT+yBma7XL6cv7cR6aU+Acf4XIlg4uAZ8N9b60Pms03Al/6gVN99F06ratDQH9UFxDyT bF2kbeqxIzlP0Zo8fTTL6InR6d2pIQobZI3WMCAcGh/3dW6cS+RfOuUC9x+6QerVsNCX DUB72UJMTkr8ihz8se38YcGrCiiOQppcgnmmy8tkrHtkdg81S7bPQNZdZoV3X1M817s0 ErR7JAtnj2SNKJwmjNh1Wi2jhfdsz5kNn/GRzhOwuOJAJMgIwGMs1kuCdJVZutwlMhYN ma9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0V0GcTUm; 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 d16si17655198pfv.175.2022.01.24.15.48.22; Mon, 24 Jan 2022 15:48:34 -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=0V0GcTUm; 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 S2362186AbiAXXlw (ORCPT + 99 others); Mon, 24 Jan 2022 18:41:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1841134AbiAXW5l (ORCPT ); Mon, 24 Jan 2022 17:57:41 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 361B1C03463D; Mon, 24 Jan 2022 13:12:30 -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 ams.source.kernel.org (Postfix) with ESMTPS id F0E8CB810BD; Mon, 24 Jan 2022 21:12:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26B7FC340E5; Mon, 24 Jan 2022 21:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058747; bh=tc4vaYi2tH8OU8FZACwACbNtaBA8r1yAdX/YVgAuQhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0V0GcTUmw8QtD2LZpo5U0g33KqVRJs3NX5d6vcYVuy+xe1ZMJEJYdmOTJTxL70TlJ r+5KUG9GtT9sYD96QT0CYMqKCrzfh1FpVZPxmtEXEfqTsySwjYrrfQ8v7RmBbP9y/e Ro1n1QPuHDzJDwOQHNAL5OBJeUgxztQuAGJeqFkk= 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.16 0389/1039] usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe Date: Mon, 24 Jan 2022 19:36:18 +0100 Message-Id: <20220124184138.394212355@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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