Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1115369imm; Wed, 1 Aug 2018 10:25:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfBtATBaTAb+4OqQpmiiWD1ZBAfUdUnvvt8ltXNJW7n5GyeqQZdkYBt6L712V3eB1mLDcvt X-Received: by 2002:a65:62d8:: with SMTP id m24-v6mr25663440pgv.307.1533144354990; Wed, 01 Aug 2018 10:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144354; cv=none; d=google.com; s=arc-20160816; b=ph2hEhRsBcO6/5jRQE5SGkf+K64GVxUNkpBJBPk5BMiCxiMcUZdGLBU8f4mL72ouNn Grr8I0pkvVHdy6LoeRvUdqHEKy4s5YnPcHqNhp3/3HocQMs3L5IH/LdfLT6D2OBgIisC eQQr9VR3Pe5eVAZeZ3bHXLHRS6aliQV0YsIM7iKMs+K6rO/U6ZvnpOSykVTvFVLokJDx ChR1N0mPfXd0WXKMlD9XAS1tljfe9JPRT3liVGL6hyi+I0NkueOci7ncCcA3Sz471ZDL MHzUltqBPQJ0PpucYuTCUPpaPWezHeJtsL8RIlveAb96d6mZ+KrqEz6BO1CgiM+5Luuj JjwA== 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=RKyCcC73jNo7GzlYbQcBw21ISYJCJfwJJtBlDlh73/k=; b=DZteRG2JMp4+OgJ9fPjZynj2KlvlfPjvQrUjTqO2Po896QosSybcihZIkwvLIul8Z4 O6paluw88uY5mDN0cXEl3S53zMTgI3G58MhouDt5/RaQb70pQkjQlkeu8XgjvwmufaF9 ic9vRrZgPPWOjjdLbtBfpEEBT2v8w4IBonz5jnRIl/pgB6wgqUyn84IwWetCXut/n0lZ gnxq8j8gWLnf5KoUPsfutWXTJe2Sa8K7QuE+n1WeircQ53g9PFwNANj1jTewxkeLttSQ PwYehHQABw3kTEZTLWi2OPZ1xZaDbXzKoWAFLEOCS7lU+MX2LUmGARLDVHxrGA1eAnMV B4lw== 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 d24-v6si15617368plr.178.2018.08.01.10.25.40; Wed, 01 Aug 2018 10:25: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 S2406383AbeHATJ5 (ORCPT + 99 others); Wed, 1 Aug 2018 15:09:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50882 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390262AbeHATJ4 (ORCPT ); Wed, 1 Aug 2018 15:09:56 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 53CB9D2F; Wed, 1 Aug 2018 17:23:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Simon Horman , Felipe Balbi , Sudip Mukherjee Subject: [PATCH 4.14 226/246] usb: gadget: udc: renesas_usb3: should remove debugfs Date: Wed, 1 Aug 2018 18:52:16 +0200 Message-Id: <20180801165022.532104111@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda commit 1990cf7c21ea185cec98c6d45a82c04481261e35 upstream. This patch fixes an issue that this driver doesn't remove its debugfs. Fixes: 43ba968b00ea ("usb: gadget: udc: renesas_usb3: add debugfs to set the b-device mode") Cc: # v4.14+ Signed-off-by: Yoshihiro Shimoda Reviewed-by: Simon Horman Signed-off-by: Felipe Balbi Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/renesas_usb3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -334,6 +334,7 @@ struct renesas_usb3 { struct usb_gadget_driver *driver; struct extcon_dev *extcon; struct work_struct extcon_work; + struct dentry *dentry; struct renesas_usb3_ep *usb3_ep; int num_usb3_eps; @@ -2397,8 +2398,12 @@ static void renesas_usb3_debugfs_init(st file = debugfs_create_file("b_device", 0644, root, usb3, &renesas_usb3_b_device_fops); - if (!file) + if (!file) { dev_info(dev, "%s: Can't create debugfs mode\n", __func__); + debugfs_remove_recursive(root); + } else { + usb3->dentry = root; + } } /*------- platform_driver ------------------------------------------------*/ @@ -2406,6 +2411,7 @@ static int renesas_usb3_remove(struct pl { struct renesas_usb3 *usb3 = platform_get_drvdata(pdev); + debugfs_remove_recursive(usb3->dentry); device_remove_file(&pdev->dev, &dev_attr_role); usb_del_gadget_udc(&usb3->gadget);