Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1491607rdb; Tue, 30 Jan 2024 23:19:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJPD6tNog37z6q7EtbPoek0nNYzMMeCky2rhdI9gITZ9mT1tWf72bEm9c5l2JNY/aHuGn8 X-Received: by 2002:a17:90b:24b:b0:290:3e62:93fe with SMTP id fz11-20020a17090b024b00b002903e6293femr1000339pjb.7.1706685593686; Tue, 30 Jan 2024 23:19:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706685593; cv=pass; d=google.com; s=arc-20160816; b=j3kheVbNrs9vUIqwBsx8DSoFaw3zkmcl2/Jqv4BnERHvuERrn1GqKqgogdUm46X3oK TbLMyPdkwunSdT4IluLdgrFVk2S2Z1QeWH1/CaOl8rb6k6aZ3uHKMpcFSBUdUKwSAVXc qH70OrKBPf+KjZjqcYhmL3W0rGf8HI4247kdPiHZEbmu6g16c1hCz/8K1eqvqu05/09j mkmkQ+pv2vDFEhCh4UKEYg8pcFIOUIt2uF17VgZArl+/5/O1ct+vy0r7LlpcD6RzXpjw JK0u7mgN52q/BYRQmySIzb2+uDAPFb2UOMoAs6ULdLiLQIXR9JinMAglzXgd0jLLHTWc QZTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=w6SrONxAcUL+4nL4MAcXtd1azhlAyrb6XByXAS01m78=; fh=EYbpajkLi8XyQD9ohcmQ/br2LRB3uKbPiFs7CUx7muM=; b=y9FJtcy2cUd3P4ZKiOEKq5Oae8QKhoaGhapkROoadjV+roMFA1WDCaKThQT4CtAj8g K8jctcvShEk3F6jA0eTEBGO+Of4grWsg7Gi8FGGLwK1JpZ+3dOtjfBnGZJk+ABQo/mSu WqAF3iugPF53uCf54ALXUmdSHNfcs3PQDhfV0qZdcRK71PJ1+FhG1PXBjEK1bDkltb8w jLOKEfcrxZeeBEIXLiR0F0lbSi+KF9mlNSVKJ/B7ZTLhdAeQHwuGpRjCSsbBKwDR6a6y c671RNi7uC/664BihFQouNDznsaQWhlVmKS2Z1Hb4hHXrEVG1bX5VZwDQrSuha5Bsl7w nGrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O6IBb2YB; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-45878-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCXrEkZEc1ia4B0Q4lcUU6gaTiRh9I3KDd9YxEg+1qEtpVJBQwQGnN33Mbt0CRIALT8ITk3khZ+zFUwOWsePftH4NNhF9riEz8vH5295NA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d13-20020a17090ad98d00b00295b08ac6d7si624801pjv.16.2024.01.30.23.19.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 23:19:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45878-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O6IBb2YB; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-45878-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9A169B23850 for ; Wed, 31 Jan 2024 07:14:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F6E776C97; Wed, 31 Jan 2024 07:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O6IBb2YB" Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8471D4E1D6 for ; Wed, 31 Jan 2024 07:10:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706685034; cv=none; b=qOjBX/1lm+dZbkFJkm2muPJHnwQbPxaukbNRt4OADE+oracy8TMr8XvWliCKbExB+V2GlSsjr0SpNBQlF87lC7AKBzmUbdwzQ5zq4cFJeKCT6KbEHKV1mqwdD98Jl2KrF0wnsvlEOjv2daGrS9ADrnmPEqpmaHIx1FrulyGlrnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706685034; c=relaxed/simple; bh=9s6fOH0qLp1ufgO9rf8HAxDGnWALf+j204n54W87KLk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=kqIgWsCgqRxDLOrdZHB8y63oCpGGULRc4Cuh9Mv48po41nf1nF36rK3BJHhrdV24DaNLx7ZfK40fbHcPrTo0zxzYNbUfaerx8XMpYu2PvxfdQQBthNSYDvgn5GNFv443A3Ta746xm5wul/2jSF3ZWwjkUexRkdnT0+JoClEIDmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=O6IBb2YB; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40ef6bbb61fso25233875e9.1 for ; Tue, 30 Jan 2024 23:10:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706685031; x=1707289831; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=w6SrONxAcUL+4nL4MAcXtd1azhlAyrb6XByXAS01m78=; b=O6IBb2YB/PMEmbZy4aNTyIcgIvxY81GNbSWuTY/KCqu429NrsAe9Fd0scpAYXK/gBf sLmR02ZcxyQERtCzVZyBn7YjqoTHKGPA/TDR0Hi7uFSmxMinrusGbXnjX4rYbBa4/qqP +D3BHk66gr27a8NNkBmphT0hQ9pAB4FsMfmwbfw/jj2qSBbEjBfUAJTVGIUiA0crkoa0 7PcOtY2fZ+1KwXBoO6YLqYzOSq6ArDxrDfUyMFyyw9STI5UqTH7h28pr5pDKtPCFfAAB +SQkmHfk5cuIP0eXyIvVAOnt2nijFX253nytdK9076qAtz1JDgHH4OP3aeqCGejIsTCw zK2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706685031; x=1707289831; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w6SrONxAcUL+4nL4MAcXtd1azhlAyrb6XByXAS01m78=; b=HUaTh2msMRttbwOXPD0LwGRE9zUZx4qZ3tjWw4aIe8/PTTiRPdikywfIB8CuUJ4v6B 8//wjOH86LM/uJ1BsWtKv8628HpMKjjdL7oVMqPWR7CErk+dFnVmSeKk95V7sl25p8eO P1+QyGkPPRervLiv7kICxCUSz09f27Lnb1ipOfRTY5PV1ED88Ko9qZSBVDd+MVJYnVfR 9LiLC8sHN4bBc0jTclc8KeA9+qJS9LOySd0lkUsEbor0DoCDWS6GX6lbMStu796kSJsE D7dCyCxeRtpRxwWLqv58BBdRxUUN1KkUqTWknd81BwUwb0SpoqT4gBdRC+uejMcILSzc mc9w== X-Gm-Message-State: AOJu0Yx5eVgBjYfY34x5R+zga1oXBZjBWInW9DBJMraOtzAxjHyGYKzM jHpXK6n76kr4sClqJBi07xWjfzHuj4qcMqDsCFn9P25xKy4Q/KCgjvWvlvTBLYo= X-Received: by 2002:a05:600c:4451:b0:40f:225:c607 with SMTP id v17-20020a05600c445100b0040f0225c607mr585093wmn.14.1706685030837; Tue, 30 Jan 2024 23:10:30 -0800 (PST) Received: from localhost ([102.140.226.10]) by smtp.gmail.com with ESMTPSA id j27-20020a05600c1c1b00b0040ef622799fsm657432wms.37.2024.01.30.23.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 23:10:30 -0800 (PST) Date: Wed, 31 Jan 2024 10:10:27 +0300 From: Dan Carpenter To: Ran Wang Cc: Thinh Nguyen , Greg Kroah-Hartman , Peter Chen , Frank Li , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] usb: dwc3: Fix an IS_ERR() vs NULL check in dwc3_power_off_all_roothub_ports() Message-ID: <71499112-4ed3-489a-9a56-b4a8ab89cd05@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding The ioremap() function doesn't return error pointers, it returns NULL on error. Update the check. Fixes: 2d2a3349521d ("usb: dwc3: Add workaround for host mode VBUS glitch when boot") Signed-off-by: Dan Carpenter --- drivers/usb/dwc3/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index ae189b7a4f8b..4e6239d3a0ac 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -35,7 +35,7 @@ static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc) /* xhci regs is not mapped yet, do it temperary here */ if (dwc->xhci_resources[0].start) { xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END); - if (IS_ERR(xhci_regs)) { + if (!xhci_regs) { dev_err(dwc->dev, "Failed to ioremap xhci_regs\n"); return; } -- 2.43.0