From patchwork Tue Feb 25 11:02:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13989821 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 5850214658C for ; Tue, 25 Feb 2025 11:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481380; cv=none; b=TgyWVLYHvT2ajp00unBB7VlY5vXj8RE2ofMhdbAjog4efO1sClsgUra2e1cWVIaivGaQ41LhEDzAnTnfUvGzXZTcyltogPZROeFW0lxkTA8D5uyeaaciIM/rOv0bPCOeHq6NR4heVOmDKDZxtUTeDlZ39L7YHZIFF6D2+HHnhaY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481380; c=relaxed/simple; bh=gQc+M1MxzMAK4raon5GNtplgYSMzzyLfAB8UOS9YtMU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kP1w4jPurQ7NFA1nfuWU9b24AuGC94b26L/64jOXxxMs9VipbGWIBRqvWNez3q3AM2In4u4x3qYEz2is/8g6QR8h8sGEew6h5GNkn0rDLQwQP+oc8KfpfxayCdQy+MEXKgyO1t0hzPEFid1R1TDBxDTyE2/iq2XYwbtYYMcJPjE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=GOLogiGy; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="GOLogiGy" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-38f26a82d1dso2784489f8f.2 for ; Tue, 25 Feb 2025 03:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1740481376; x=1741086176; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cyShyny9G2/yY7DkjMFQ2r6rzy1CSrizU536iAKhGig=; b=GOLogiGyWvjTaJcyC7f6K0r5ZP9Mb8CFXnYuEN/xjq2YpZhOd8sc+I2Zw9h6vSwuR0 ZQBdgV+cGtoZe55K2jGhTsPTyFvYpiBbs3vB+wpa6f23OQ6qDHQ6kd3bPzjMg4HM/ZWP 8F7UmYi5Ef/0VwI1ElmOMN19FY0Dj3WWHvBid2Tu7xwHaMorPxIEvHTJeZIubiJFipEp sXqEAxa/ymuT4dYYbuJvf8clH13U2ggpInsxz8XxcuABqvkBQiVTLnt9v5ofkSQbxA0G XLYrUhty4pWn5UjONMjugI2hREyDiHQ8TmSgczhn3OJKr8Z2PC3wH+z6o2KBwP/7PAGW /zHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481376; x=1741086176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cyShyny9G2/yY7DkjMFQ2r6rzy1CSrizU536iAKhGig=; b=RXujz249s5A8eHb6rIwfgF9OLy879M5SfJMezvQ1oJs+OdzepYFwECKompB5BcREOb mbe/BQD52COECM/H1UFo9qGI8liLsXfNyRr1lt2+HCX6+wv1X2PFpl8LICIrBqD4AXGE qJNnZNorV5IW8LG3rsh28xc6zRplQo592cL4una90cRh2Z28Z5gzCTVTGH2EoE2yGTL/ c5w5+n8/BDWqOxnyA0HltUjqZD76GWns6hzB5g2mftMVTSSy8gIdQOTkrC0YQ70xrziw a1aHfEohCjaNP3bZqYG+oVay4qWHFo8B/ftPYZIc+HMTg2oFl630Ma50HFCObvqq26pd QpHw== X-Forwarded-Encrypted: i=1; AJvYcCWkekmZe01VxQ5iBYiBpMxUuVvia/n27mSiPRl6SHV67hviA7Ua4jzWA1SrovPxzSBmVkn9m0QbrCo=@vger.kernel.org X-Gm-Message-State: AOJu0YzHaWg/AOenexiiNv3mpDp7avmjXpf/2kskkzeVAPerIXzQLeaO Zf+gyraa0tTDDospIkhOBSkYEfoJ+t83DsThqyLXqxKDv/npNr7UOZkE3NV24dI= X-Gm-Gg: ASbGncs1cUg8WmU4ChGj8EaWwTIjxnDlW/G2zbrQJs8t1+ldRdM/orFK+kD2u4uKtIQ krEMDmjwxOT4Adon3BnVVP8y5uhP+hT4GcYH4Zcaw7yc5V+XM7HI407akTwuHFNbU2NXaUx2YKY 3fD50nreOlip1CXXFLW63ZJnzfwkfDEcYudex+Z7AiR3QRxh7EGU5rE0ec7oS4HFHNxXn+77xZ0 CiGPKBa9v6H8vIcWwYKgATIjjrFPxktr2YWmdgjMM9maHXmN/J592te+F7xobbhurz9luMEy/3J OLVKOgsGNTCxPY66cuJD/ociyTxZ6+90sQXMgoHtW4ks4Gba7qEUEHc= X-Google-Smtp-Source: AGHT+IHGZ6gHlw9kSoahDWlxrbg/CLJ26q2dMB3XznLEbdWlGW9T87Nbkw4gSgN5rUEuHOYL93HXMQ== X-Received: by 2002:a05:6000:1541:b0:38f:38eb:fcff with SMTP id ffacd0b85a97d-390cc60a682mr2129316f8f.29.1740481376531; Tue, 25 Feb 2025 03:02:56 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.25]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab1532dccsm21972385e9.7.2025.02.25.03.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:02:56 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: gregkh@linuxfoundation.org, geert+renesas@glider.be, biju.das.jz@bp.renesas.com, yoshihiro.shimoda.uh@renesas.com, phil.edworthy@renesas.com, balbi@ti.com, laurent.pinchart@ideasonboard.com, kuninori.morimoto.gx@renesas.com Cc: claudiu.beznea@tuxon.dev, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea , stable@vger.kernel.org Subject: [PATCH v2 1/3] usb: renesas_usbhs: Call clk_put() Date: Tue, 25 Feb 2025 13:02:46 +0200 Message-ID: <20250225110248.870417-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250225110248.870417-1-claudiu.beznea.uj@bp.renesas.com> References: <20250225110248.870417-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Claudiu Beznea Clocks acquired with of_clk_get() need to be freed with clk_put(). Call clk_put() on priv->clks[0] on error path. Fixes: 3df0e240caba ("usb: renesas_usbhs: Add multiple clocks management") Cc: stable@vger.kernel.org Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Signed-off-by: Claudiu Beznea --- Changes in v2: - collected tags drivers/usb/renesas_usbhs/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 935fc496fe94..6c7857b66a21 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -312,8 +312,10 @@ static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv) priv->clks[1] = of_clk_get(dev_of_node(dev), 1); if (PTR_ERR(priv->clks[1]) == -ENOENT) priv->clks[1] = NULL; - else if (IS_ERR(priv->clks[1])) + else if (IS_ERR(priv->clks[1])) { + clk_put(priv->clks[0]); return PTR_ERR(priv->clks[1]); + } return 0; } From patchwork Tue Feb 25 11:02:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13989822 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 359D02676F9 for ; Tue, 25 Feb 2025 11:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481382; cv=none; b=oQNfnbwIPH0KfSHIt+q2/KsNBjVWSfv0e3ymC363Ot4d1UyST+kbHKftF37m3Uhtvg6QWaWH6wbpcyXzj2iBmvafL6OT9gH6iqQOM6cpaL7Q3J440EvCLQEmKJB1IV9rZL9ZJVrlX9Y/WEcQhXEGw527A4M8c1SrTdhYQRdBpTw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481382; c=relaxed/simple; bh=EFoTjmBvFXfXjWb+GX1/FcvwY+PND4is0Ol1b2EMzJs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qfL6lGyZjxqM1wsR3P/quZtN4JXHlYjwvoJo3PKIFcdoWaczxwD6f4FKJE7hr1GmUoTWyD9SiIjyhh+WWos886UZqCBzsFMFcuuRL6D0xvNs75TH6/9Lxz69Iz2K1WdAGWdjKzbkub/46V4wRDGOCCr/AkT/uSkJ9UNkjfn5MJc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=k14C2U6n; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="k14C2U6n" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-439a2780b44so34110035e9.1 for ; Tue, 25 Feb 2025 03:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1740481378; x=1741086178; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1g90tifgQM9MVDjBzO/J2Q9Ytv3puck/TcrC4X2HffE=; b=k14C2U6nGMHsF8/MEKTGyx66X/GNX/AXIuxMBjthOmHyCVh3Qs3d6RCIodf3FL2KB8 ZOEgIsQ5L9Yisrg4dL+bMYNoduIE2WpcEkyrlN3WZwoPLKL0EVjvxLWhcasXzjLWhXaH 8Dw+UHLTblJvNiXztWWwWvP+49ExEwDcWxFvOlpPxayZkWHXyz9yTXBHo/DLHowNO5Ls C6A++u09CDhYP1b3aZx/MP7jurtIkfa3+p2T89o5IcUJirKjAVyYaMD7fXnDZvgH9lMS xmKyYNs48gjm91WmA7YsSqYrnicAaIWdRBgeJpuKXL2mWdIaZtu1kNJsZoyCPaPPvVT0 7HcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481378; x=1741086178; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1g90tifgQM9MVDjBzO/J2Q9Ytv3puck/TcrC4X2HffE=; b=FYpGt1k5bgJEo8fPftu5qcUSO06nYXATS6OdB16M3auAc+eQgaggzntL6bgU7ZGYue yA+WA1Y8Gf8DlKQN1sj9Uw+4IWiUqlaCnvoEZBLwUWx+fyWSJB/6GnLiLLrBq6q6k52r LMVNZkxOXszY120zcXNFPZp81OcNTSeqySCk9073EhZHT65EyRI8dByzCIshacEZmN6G sEldEd67iOsGXjxj+pRwcK0tcuuqZdOTF8dgQ1dC7u1S1NY8fdU+1N1hyG4bemkISa0O czdI0VSYsfozqQlCApBDUr7YTa5FE3lZYvqw82FiGvMoVqPPyejtHzZNEImng8t4EsNz JtFw== X-Forwarded-Encrypted: i=1; AJvYcCVnakh1WK2XWMVDqwyN6NJY88dox6ZO2TLH/nh9/s6LdBm5jiWYgHJkjbTAsqXlxT6RHvDe8iV+OAU=@vger.kernel.org X-Gm-Message-State: AOJu0YxYufjBD4M0jEMrM30EOLoWHQuOKAl5qewig9aE21L3pgWHHisl 0EHwT7KPoc47DFjdCIZZP8KHu6kue4RfVEt4m2rsp/sG78+Bp7nirbONZc9sIus= X-Gm-Gg: ASbGnctfKhdsivKRiAnsNepq08s+6GbnhoIWPoUQs+yioEXqgbV3IUu0J0XvQxkn/ps uNKgM73Bx0bhTPmN921q+C5D9IC5qxi8DqbLsRonS9/xRRLqaEXSlcRrG6nBbhPDIHf1MbiXAjb GoQcSIOIR8kfOA09qh+03Cd27/iBN83wMPe/r9QzF/9t0Q7dHG5gPhrRtnJj/BZGaBXPYSl1zDz Sl8WIUErhWYN2TV9Ix5JNNB6mQKM1Q1e0NkIVYd1LLsL0B5jCDUJCmqiVJ25V7rx32g4wJzGKVW NRpB3db4PRsuAnRaiS6TSodzX92hVtnaLmsswkXSvbxTuUDUukceQTI= X-Google-Smtp-Source: AGHT+IH9p4vFb/WlIcpRZOBte7JgwwPLkhCZmRimhOlrCUbR7HFlC6wBkzx+vvYw/CKT/Zad3bHmmw== X-Received: by 2002:a05:600c:4f84:b0:439:955d:7ad9 with SMTP id 5b1f17b1804b1-439ae1f145cmr171014845e9.14.1740481378537; Tue, 25 Feb 2025 03:02:58 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.25]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab1532dccsm21972385e9.7.2025.02.25.03.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:02:58 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: gregkh@linuxfoundation.org, geert+renesas@glider.be, biju.das.jz@bp.renesas.com, yoshihiro.shimoda.uh@renesas.com, phil.edworthy@renesas.com, balbi@ti.com, laurent.pinchart@ideasonboard.com, kuninori.morimoto.gx@renesas.com Cc: claudiu.beznea@tuxon.dev, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea , stable@vger.kernel.org Subject: [PATCH v2 2/3] usb: renesas_usbhs: Use devm_usb_get_phy() Date: Tue, 25 Feb 2025 13:02:47 +0200 Message-ID: <20250225110248.870417-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250225110248.870417-1-claudiu.beznea.uj@bp.renesas.com> References: <20250225110248.870417-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Claudiu Beznea The gpriv->transceiver is retrieved in probe() through usb_get_phy() but never released. Use devm_usb_get_phy() to handle this scenario. This issue was identified through code investigation. No issue was found without this change. Fixes: b5a2875605ca ("usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUS") Cc: stable@vger.kernel.org Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Signed-off-by: Claudiu Beznea --- Changes in v2: - collected tags drivers/usb/renesas_usbhs/mod_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 105132ae87ac..e8e5723f5412 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -1094,7 +1094,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) goto usbhs_mod_gadget_probe_err_gpriv; } - gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED); + gpriv->transceiver = devm_usb_get_phy(dev, USB_PHY_TYPE_UNDEFINED); dev_info(dev, "%stransceiver found\n", !IS_ERR(gpriv->transceiver) ? "" : "no "); From patchwork Tue Feb 25 11:02:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13989823 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 5DEA5269D13 for ; Tue, 25 Feb 2025 11:03:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481384; cv=none; b=cH0nQ40fa60c/3IlsPdIOHK0nfA7/7BqI5ayqrCNnvIEhGJyp4au5GT7QYr8NsORtvqFBWjjD2HIgoY1Bx0MFBoRqWELIFAdInZ/doqsAHf96to5lehMJAUw4KNpJdtl/hD2YCudai8ak077xmvGGxjW7EW2dKnJpVX1zkkz9sw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481384; c=relaxed/simple; bh=wfAXzIwhpO2+XBWyWSyz/a4LEzq4MtL1mGejXu/tojw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ky2gKlwgDXpPOykswuAf3KUgtJ8ztaAZ0WDwgXgUfLsBYaSqoX7n8KN+1cTp+Vjqo1Z/FBHf1xjpCECorOmccbp+ulghTZbX+Gw5Ohu1qXjY0vBWmZKtCSfedRGswBsc2/KN0j4NCnipFjN81Lqrml1jtk6vbTQwy8FNh5JbzXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=V5q5A13x; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="V5q5A13x" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4399deda38cso33139595e9.1 for ; Tue, 25 Feb 2025 03:03:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1740481380; x=1741086180; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MLlb4o6UgVUoN8Zxl4PnDYtKUduOmsdnArEn4cXecec=; b=V5q5A13xNgzKTlt4BHIoxSOjLYYounscGx5id6qqSqUQlgxsFmtFXtNpsJ2QSrJ/EQ GFt76qN6MvI1ses50OL+mkQh8xgTfgQggGSqM/u+pihiH5KbTmjRTyJIulV5GAU8CJZi /Aep5x/YFfK6XYaDdjkgaCMzH7tzczt0hxF6eshhAHYdQ+4GHt6faBw2iRLj4fobDCHR BzYwfeElhMjhQbPvlgz5hzmd+F31D4CrGYvcK6tHuPet47uFLysahPsNloo6gF6Frg9U 7HGVWvk9zVmtzgsD0W8JLzKUJe7Rv4vv2x/77fouXJFBxdvsbMemuzS+U/6o0yxFi89Y cizg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481380; x=1741086180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MLlb4o6UgVUoN8Zxl4PnDYtKUduOmsdnArEn4cXecec=; b=ZCzBDthjbqRq+9ecvhnmz+Bd5cGy60ZEG8677kLt9Ln47edLD9unbTnQDmox8FqZ5S zyJNtL4oRX32Q317adqZQ3Bo2Pzm4oflHewWfs8MChnqNhJV0CgFa0BVRQhd9xTx4RpC ++oPF//7v17zoAuAESUcemUWf2qmW7Ak5gQlpJ1aJ+XOHtPryqQymhUVe+H7k+tYkKL+ c734omdh6+k5zwjsa4q37YM9krMVEe6OKmb+A0kX4H+AR4M0aFkikuPR87h2zuxi+SmG jmPyT2SdAUeFjuW3xjd0dfp9BY91gy3saEeAkskYkqSanJ6E98n/j1bDAfAzgwNVeBfm ZUWA== X-Forwarded-Encrypted: i=1; AJvYcCWxwElUVeEgF21K7IJhNua1c+puCJhnu4A690r/B5yfxalufLqcypmjKzOOVtLpBOFnsOy0alb7EKg=@vger.kernel.org X-Gm-Message-State: AOJu0YzL8t9zkECNf0blbsqitCIPnRMsaJX7qfodDMVPpVeeJhXtN3IJ zU2egvaUi7paZvoj8Gn6Qntqoj6pg+WxrmP71m//heJhLcDeyp7K7X2fcFvsuKE= X-Gm-Gg: ASbGncsuTchszOfgiA08mhqmRs5pL7HOuj5etwzTFM1kOIcWGF1U55fVWMkM0spwFOQ UlG5kB0Z3dPaW6JAONfutrzlqDV69hMGMVn0bKB8Oy3oUFUtU5kE6e8/X0/PtlpoU1oyK0sZk46 kuQgJBYFbf1CGt1wqoZBPlc92LYCCPB9O8Og7gW3g0P4ZT84Z+Sp1VB8RgH2YYeA+TG/Lpz/+Lj /r7YLnTlV4wFLJDmlSbBtdAjZFmFEr580rNlgTha+VrRjRZJOH5ujwCe0rNM6SQLcAsl022Ab16 0wnHCZUuIv9+DgwLGYfsZP5s0IrQShwvPTwxrqvkyV+eFX+H8shsLWs= X-Google-Smtp-Source: AGHT+IG6x8BDpeuUVBGxx4Hc7o7ngM89f2LcZF9li/1kqsl7Q4UaDPQZkhe1oRcNJoNTO05ND2z6+A== X-Received: by 2002:a05:600c:154e:b0:439:a01d:379c with SMTP id 5b1f17b1804b1-43ab0f285b9mr25045105e9.4.1740481380640; Tue, 25 Feb 2025 03:03:00 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.25]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab1532dccsm21972385e9.7.2025.02.25.03.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:03:00 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: gregkh@linuxfoundation.org, geert+renesas@glider.be, biju.das.jz@bp.renesas.com, yoshihiro.shimoda.uh@renesas.com, phil.edworthy@renesas.com, balbi@ti.com, laurent.pinchart@ideasonboard.com, kuninori.morimoto.gx@renesas.com Cc: claudiu.beznea@tuxon.dev, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea , stable@vger.kernel.org Subject: [PATCH v2 3/3] usb: renesas_usbhs: Flush the notify_hotplug_work Date: Tue, 25 Feb 2025 13:02:48 +0200 Message-ID: <20250225110248.870417-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250225110248.870417-1-claudiu.beznea.uj@bp.renesas.com> References: <20250225110248.870417-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Claudiu Beznea When performing continuous unbind/bind operations on the USB drivers available on the Renesas RZ/G2L SoC, a kernel crash with the message "Unable to handle kernel NULL pointer dereference at virtual address" may occur. This issue points to the usbhsc_notify_hotplug() function. Flush the delayed work to avoid its execution when driver resources are unavailable. Fixes: bc57381e6347 ("usb: renesas_usbhs: use delayed_work instead of work_struct") Cc: stable@vger.kernel.org Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Signed-off-by: Claudiu Beznea --- Changes in v2: - collected tags drivers/usb/renesas_usbhs/common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 6c7857b66a21..4b35ef216125 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -781,6 +781,8 @@ static void usbhs_remove(struct platform_device *pdev) dev_dbg(&pdev->dev, "usb remove\n"); + flush_delayed_work(&priv->notify_hotplug_work); + /* power off */ if (!usbhs_get_dparam(priv, runtime_pwctrl)) usbhsc_power_ctrl(priv, 0);