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,URIBL_BLOCKED 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 22559C43381 for ; Wed, 20 Feb 2019 16:55:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8CBF21848 for ; Wed, 20 Feb 2019 16:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550681736; bh=LlIKISnlGCTUrK9CHf+0IoPq+iuAJMbXJZKcA948igY=; h=Subject:To:From:Date:List-ID:From; b=l1vVZ6SAyZLyjjEdG3MM4QCg7aFTnzWY3ddplPzBTPNF2XojHAfnhvu5NhHdlezft jFhMpa1xpux494ATG7CzsZTlOKG3VEkvjFZSgSavstBq0obnQveeGHfDwrWvjRqdyt zhxwA6Y4NMYjvkNsMia6XM2KA5Nzosv73RnT7H5E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726089AbfBTQzf (ORCPT ); Wed, 20 Feb 2019 11:55:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:42280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbfBTQze (ORCPT ); Wed, 20 Feb 2019 11:55:34 -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 B90662084D; Wed, 20 Feb 2019 16:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550681734; bh=LlIKISnlGCTUrK9CHf+0IoPq+iuAJMbXJZKcA948igY=; h=Subject:To:From:Date:From; b=yPx1e1pgHbxIK5An0yi0LoHHOyrm9EMcxM70RMfEqx5KcJfG+r7D7r34kwEpK6j6R 7RGg7ADY7XL/Cc4ayDtzwEUVHy3ZAJo5Ag7NGavgSN4Q/N53AtwvpDELUlhc5wPKLO cYADmj5jCjtgcDQNpapvsBY8NfufxZeahy5ofFps= Subject: patch "xhci: tegra: Prevent error pointer dereference" added to usb-testing To: treding@nvidia.com, gregkh@linuxfoundation.org, jonathanh@nvidia.com, mathias.nyman@linux.intel.com, stable@vger.kernel.org From: Date: Wed, 20 Feb 2019 17:55:30 +0100 Message-ID: <15506817308332@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-testing 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 be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open. 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