From mboxrd@z Thu Jan 1 00:00:00 1970 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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS 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 D0C74C43381 for ; Thu, 21 Feb 2019 08:41:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93A2E21738 for ; Thu, 21 Feb 2019 08:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550738476; bh=hp19+p5EMGPA4zbPeooCm6LqoEHSvjN1N/EVV+ETme8=; h=Subject:To:From:Date:List-ID:From; b=oyAR1L1lOHZBonCK+RYYRyrP09nQ1c5oHZH6IaKffIxJMbQ/2OfbL9+koh496g5FN IvXIUAUPfAyYCB/9Xwn/dBjnlia8ZzYfizK1oDgPHntYAhFnpOrKY5zCe9vMXZ7CCF akS/ZEnTARR/QP9pGWdF7y8IyJYPxkD5TNrcGsPg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726260AbfBUIlQ (ORCPT ); Thu, 21 Feb 2019 03:41:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:38108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbfBUIlQ (ORCPT ); Thu, 21 Feb 2019 03:41:16 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AFDE4214AF; Thu, 21 Feb 2019 08:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550738475; bh=hp19+p5EMGPA4zbPeooCm6LqoEHSvjN1N/EVV+ETme8=; h=Subject:To:From:Date:From; b=WASe+0kUjBPR5sDzC8vRHtug5ydRAw4csQhxZsCOPLVzteMEeSjAlla4c2rMVgFES q5cPXtU2qfsmDEgHWEFKLuvh0qG+Fg3DB87PAGUfUDwwm8EUB2jTCTBBCfo8zvQmhC y45RPiboIkVUWmd2B7JhdyUpCuHujzdfejjxDIAU= Subject: patch "xhci: tegra: Prevent error pointer dereference" added to usb-next To: treding@nvidia.com, gregkh@linuxfoundation.org, jonathanh@nvidia.com, mathias.nyman@linux.intel.com, stable@vger.kernel.org From: Date: Thu, 21 Feb 2019 09:40:48 +0100 Message-ID: <15507384482862@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled xhci: tegra: Prevent error pointer dereference to my usb git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git in the usb-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From 0326ccb5feac6eac35ba6254260e2774277cd976 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 20 Feb 2019 14:48:41 +0100 Subject: xhci: tegra: Prevent error pointer dereference During initialization, the host and super-speed power domains will contain an ERR_PTR() encoded error code rather than being NULL. To avoid a crash, use a !IS_ERR_OR_NULL() condition during cleanup. Signed-off-by: Thierry Reding Fixes: 6494a9ad86de ("usb: xhci: tegra: Add genpd support") Cc: stable Reviewed-by: Jon Hunter Acked-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index 938ff06c0349..efb0cad8710e 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -941,9 +941,9 @@ static void tegra_xusb_powerdomain_remove(struct device *dev, device_link_del(tegra->genpd_dl_ss); if (tegra->genpd_dl_host) device_link_del(tegra->genpd_dl_host); - if (tegra->genpd_dev_ss) + if (!IS_ERR_OR_NULL(tegra->genpd_dev_ss)) dev_pm_domain_detach(tegra->genpd_dev_ss, true); - if (tegra->genpd_dev_host) + if (!IS_ERR_OR_NULL(tegra->genpd_dev_host)) dev_pm_domain_detach(tegra->genpd_dev_host, true); } -- 2.20.1