Received: by 10.213.65.68 with SMTP id h4csp1729794imn; Mon, 19 Mar 2018 11:38:54 -0700 (PDT) X-Google-Smtp-Source: AG47ELsMXqC9536vZXeCCYRHkkVdycmtQflOuI7Q3Chym56Az/hsw0UCWzdvTlsR6tEQharGRYO7 X-Received: by 2002:a17:902:5957:: with SMTP id e23-v6mr13186404plj.323.1521484734219; Mon, 19 Mar 2018 11:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521484734; cv=none; d=google.com; s=arc-20160816; b=PsXzxJEpkqtgYU0sW69HX8S18Z0y+Vzw3ExnRZrPeX8P0CziNhV7sDJ6fzi49+fq0Z HT0Pf7p4cp4xaqiGiM7Vmq2RXHVsDoDBBoFi1FbONeBxM7uChGf2ga260gxo23LQ5VKI +iuscZbNmOqN39ChEGOtMHxR/9kYov6OJ3d1onVdpUVvXFKwAnvl9bXXHTKR9R/fCSME joLedA6JGbl08g8GyR2HVp/81bmcEwwldcmMsBYwNn4gSqtjebfhPsH2MzVc1Xg5Df41 Hq55Fvp9GPkABkQ6nHhQhnKL95CntLEsDCmAoRTJwCqa0TEz7+T88udmfCPz70ETqgD0 fsfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dwDFlkmLG6gqLWZ7lPpRJUaA3KxNxOw4qfDt8xrQnjY=; b=Aj1D9wgpkmRNal0ha8agohnWDpm2yXa5wsaqgDs/KnC59h925EzIyiUfVyUApKRrhg a+KyKCgadqjC3NW0uAffce8VDvGPiLWWvKFCsu0rjeQ4xbUZYU4LRoEGQ6J70W412iJM MLfECVochHuYQt4OW1aFF7gnLWvhX027c8YU3W0CQoPdBHvbszAiVWFFG+ojcNPyLwn9 PuMtl7mrO7vjgy0x1uewLeRyt+Jw35+7ekFcqfw3nedsmHHFYI9jA3pvi6KikbD4xWPR WMZzGyimIN+jleq16PzAJoTgNCxT6fPWn37JPprKsDyMhZdmblhkQzbR9V/BERQHcpPL jfiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23-v6si381864plo.272.2018.03.19.11.38.40; Mon, 19 Mar 2018 11:38:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032144AbeCSSdA (ORCPT + 99 others); Mon, 19 Mar 2018 14:33:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54116 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032132AbeCSSc4 (ORCPT ); Mon, 19 Mar 2018 14:32:56 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 09F1A1292; Mon, 19 Mar 2018 18:32:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Felipe Balbi Subject: [PATCH 4.15 48/52] usb: gadget: udc: renesas_usb3: fix oops in renesas_usb3_remove() Date: Mon, 19 Mar 2018 19:08:46 +0100 Message-Id: <20180319180737.612921151@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180734.976730813@linuxfoundation.org> References: <20180319180734.976730813@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda commit e3190868e5f52fb26544f16463593d54ce46ce61 upstream. This patch fixes an issue that the renesas_usb3_remove() causes NULL pointer dereference because the usb3_to_dev() macro will use the gadget instance and it will be deleted before. Fixes: cf06df3fae28 ("usb: gadget: udc: renesas_usb3: move pm_runtime_{en,dis}able()") Signed-off-by: Yoshihiro Shimoda Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/renesas_usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -2410,7 +2410,7 @@ static int renesas_usb3_remove(struct pl __renesas_usb3_ep_free_request(usb3->ep0_req); if (usb3->phy) phy_put(usb3->phy); - pm_runtime_disable(usb3_to_dev(usb3)); + pm_runtime_disable(&pdev->dev); return 0; }