From nobody Thu Dec 18 23:27:28 2025 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 60B6D205502 for ; Tue, 25 Feb 2025 11:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481380; cv=none; b=QCKDu+JwEKYdxiPy+US0IwXHxdHsKMl1kyWyF/2TLhYtEBIhQrvCnAVRDy9ezRCSPnxPrmz2iS5/3QzKpaUBYDvvRqr6kOI73r2YRtM+ML6LCE74YT8+u15FoGrAIUHEwJ3JTxhIZAu5sMFvxaaKO0SG8z7LEISiKOeJalXrOWo= 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.50 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-f50.google.com with SMTP id ffacd0b85a97d-38f1e8efef5so3182952f8f.1 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=rN+lb5j/hmiVEHzCJGa88oCTF9iKZA9RS6bbhR8Ya4XVhcmJWbWUvcT4DcuRV3usNr 4bSaBn+uSTiVypcd9M3UuK+OaoaUPzRyPjil+DNyc9goQag5g/oEUSWNeTR0ctUh/Ttd y7IKCGX293OICwW/PWczpTpuim9QzQ0XGhUiPd8FWVDrIbAKDs1HduuhU7bFLn2FZ1WP Jm792PngfCXG3Qo+jb137LnyN7tx6GuJnAbwKuR5kOkcwt/xRgW9beop04uYQaxzuu9f q6rmjcWM4kZMzFVB1xKwB77VP8K5iWrDeaO/HZLFS+MU24hoEKj91gsiQU7f3Bil1AIX pj+g== X-Forwarded-Encrypted: i=1; AJvYcCVXjVWkl73CithoHmHUnLk+pWneHt4K8UbaRL6PYlONbengRd7RW/t1mmCvi48/n4YtITzS/HptpLs8htk=@vger.kernel.org X-Gm-Message-State: AOJu0YxUrp0bGHTa/vOH8jAajtOtW6Uq2F7/1pUwq+L3/u43uXYdyiEL Tod1YOFSb3tiKxapCvM8/6b/n38Wf6FiX8veKcqJVVpV3g9JQDngzvt1su7UW7A= X-Gm-Gg: ASbGncuSs86/0Q5FnMyGiO19j5kz7+1Y1oNKfwaL+G2cjaH9Cja31Q7pl7rrvEtB9Po DDqeVaEWKxxWUWKYB1+/89u5udC/5WsRaomrcajVLwkEG901nX7wsVjn1jf0rxhtLi1Jmh1t/VK Un1/c6bInIZSJX0nKCUwXiju8s8npXWcqamRa+oVu5kIXb1Lang4pH0dZo0eCOcWhRzfXlvZA9x IZqMVQC6c6pDiTO4ndcla1PakqhkjhUgYk/nPqdlRx/7ex/sgs/P8vdSJnb+8qeq3xnAhmoGirz v/v8lOf2kKUQPRpGyFxNmN+T3L8xZuZLd26vAMf1/3XjRXCq5rg0Hgo= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 u= sbhs_priv *priv) priv->clks[1] =3D of_clk_get(dev_of_node(dev), 1); if (PTR_ERR(priv->clks[1]) =3D=3D -ENOENT) priv->clks[1] =3D 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]); + } =20 return 0; } --=20 2.43.0 From nobody Thu Dec 18 23:27:28 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 358E52676F8 for ; Tue, 25 Feb 2025 11:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481382; cv=none; b=s2iI4hhpUEntbl+sUmmWmzGs1OZfmt1UKFOjBa9dCK3EWsdMM51ebJAA29jI3m4Y7ByNOq5Hk59u06ciirAu29RQNak+EiMDdmUk016DqRtZs5fRhFiexbQykON209BTqScF+RyBBds9Api5emPsNXF/BfMq03SyyYTfLdfdkCk= 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.44 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-f44.google.com with SMTP id 5b1f17b1804b1-4394036c0efso34052915e9.2 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=r8wAo626b5BacC/AIdjGvzizPLrDPjRBh+a27X3fY6pSdOV8TfqsoowWSi6C4/GLhK btFmprymuZgdvFaMrknkmWOA3L1JBAJMbP0okNLDVMEOYRg1fv3zfOU2EVMRy7KjiK9r 22gOeke4pZyE5jbpGh5/NbEXskijlmk3ZC58M5P5g33ALRUQ1KdgT/QtArsTxQgS7GkM iIy1j2MvKr5pBAmKXUE6A4Xe75YknmUQwZ6rB0rKnCnK35WP+lWVou/1Tc6M3t0T4zRs 0foMzVBHpXJ3Bb48dBE9I2SiTcd/+sdXkLYSfdgHPpLmn9KUQnP/rnZGITtaBqJAGcEr TXsQ== X-Forwarded-Encrypted: i=1; AJvYcCX0xY21x+xK0RHz2kvXjvHD7hzxmRUXPUirrc7K9m2UHLrAXAYfCeIZyLV5xtZ6lX/KeotrdORxcV8XDG8=@vger.kernel.org X-Gm-Message-State: AOJu0YwXE3PIkFq4FPB/MSKNM7aFPj/l1qIKb3jChp2Fez14MqUUvTnC iUDpukVpYQPs3MrEh9oZ+qjBFq20wT4LaaXfh+26VQGSQVgwYhWnWQBEs25lyOY= X-Gm-Gg: ASbGncv86unHOUBe9E2Y8lt9q7rF4/JFWE9aiEROidQ3UEYqfML0RtAqFdEy3I10F4y 2JtoEUu8WlSYdKq73g+yvPSyYHUi5pYExrk0pRiiaDQyBmMsWWvDAlU7lNAJ7oMcH/dQIWpDi/b DXHWQW4HCvDx9hj+VrRN/hxy8BWZhnzStUhHF8HjNHRlR3yVB9nqVSnoMMaKZtdkk6CyPzaeacf ERWLe2ZtzZ6mMwu7pOVpdB4j1ehEW3+db4P7jX1ApJbfZUFyNBNI90kI1ia9RQFuhax+spv/xSb jKCxDxBGeEqP4uB4Jbledx/N+US7nFzmNQpP8eYGqn5QmUmzJrYLXHM= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 provid= e 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_u= sbhs/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; } =20 - gpriv->transceiver =3D usb_get_phy(USB_PHY_TYPE_UNDEFINED); + gpriv->transceiver =3D devm_usb_get_phy(dev, USB_PHY_TYPE_UNDEFINED); dev_info(dev, "%stransceiver found\n", !IS_ERR(gpriv->transceiver) ? "" : "no "); =20 --=20 2.43.0 From nobody Thu Dec 18 23:27:28 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 4A882267B17 for ; Tue, 25 Feb 2025 11:03:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740481384; cv=none; b=POo5Qhuj6oJSP+vfJdNDFr4ow3owBk/aBqHMPx5FaXNM1w0vDBJx2gcfywX+34A1TyVn6vLfIUxbRPZFgUyeyts/HXrfQZhFAYivd/j3kTClZiMKYmQdrY1c7CK2YG/zWedAcNPk1fiA3k7gG7JrcnbvNspHQeyk1XPrqrfsPw8= 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.48 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-f48.google.com with SMTP id 5b1f17b1804b1-4399deda38cso33139585e9.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=CRdG9x0odkj5ct7l4he36JtrXgOG2hcMvJj8afVRE1SF0DN11KiMZO4KGKTVRzI9GJ kQvuNCUDgtTLa22V4afxEJhrbWncT+OUbrS7kvjw8gDRFzGAUycfcuenC7Rx78cOfqiF Sf5r/gdwoMhVSLu2H7pG2JUEdfwcspWvFSaog9C2G/GJR/UmdxCaI3ZMVvQpKfFY1fIR ETSS5KUp77f5cs4VYQJljfio774LTaYbZkBy6JgU6v8w7M8sV0yOU28cqyUOM8GAah0X PPO8unNsIlijE63BRKn9aDFdBKEKExiCm1Q9MUsBcc2b5nR1zPsOlhdELGLHVd0R1dYa DoDg== X-Forwarded-Encrypted: i=1; AJvYcCVuPocoQIkTIrQFeSKl+VwsR1QKMhoWsUBw0fu+gHUWbolKThtNzq30TXnOumigV0jif08Z6x5nbDViYuM=@vger.kernel.org X-Gm-Message-State: AOJu0YzP9wJQHtOAf/8B7QQ4gkyuCrmqMWVkYh2pj6L3ZuX3w9kMckw5 f21IjeUdAx0ErNlmO96bDNtYGCkpx1K84toABVxT9TD9Z+1UDzc4YIKuJakOfbs= X-Gm-Gg: ASbGncvlDE5yPY/a90K1bGGZobVdsJ3iWkgbNn8jyUgoD4c54WGs6EDzoDTHE4P8P2d EJbtbahNRNYhsOOIX3jJv+2QQcmB9sZXDuqiWmQ6CUd4uATsp7wXogkMjcd80kNm40KN94cT07o sxA6vJ/ptfVPaTkNMVtmTi0ywK8GdDpx/TIiqCBdAzF0ZnLWxruGBjEwsmF+AdHk7gvCo6rqH7s 1TIgsQLMffpmtIC3p8sOwTQZNhcJvgusrIyrkRk3ZLTj0FnddNqeEuYsMb/VwEoLAh53jqRl/qO YTKTUerKENf6JTu0cBNKAnhYZf9wnW3zO0h4S1S+c1Ju/UjYriEgOOI= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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) =20 dev_dbg(&pdev->dev, "usb remove\n"); =20 + flush_delayed_work(&priv->notify_hotplug_work); + /* power off */ if (!usbhs_get_dparam(priv, runtime_pwctrl)) usbhsc_power_ctrl(priv, 0); --=20 2.43.0