Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp613144rdb; Sun, 28 Jan 2024 00:48:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbKBceaqR/7X7Uv+1VowP5SNWzU1O8EAw9x/zV2C8FJOs0rL4mNpeU4rELt6p22uIfZWC6 X-Received: by 2002:a05:6402:3d1:b0:55e:eb1e:7a8b with SMTP id t17-20020a05640203d100b0055eeb1e7a8bmr324048edw.6.1706431691282; Sun, 28 Jan 2024 00:48:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706431691; cv=pass; d=google.com; s=arc-20160816; b=sVjHsuJZLMbstwz/D/0C5euBVZy/cJR2zlwKozta/isgfRbiyW7olv8Z5axxsQHfp+ PDWt9v0Jrayxo9wYdSxeWlig1j1YlL2w5fDYompdstYTw1qIKtkKMo76a3OSZcqLE8gs +ZIa3nqLH30VM2LagPyMBzb7327qaAPTuzQqMjGLT71aCd98m7xM1vWdg12LmXJkYr3O 2W2/Wjv3/O1/0q7CJXbk7EgIeEvUhTrkngzsO5aH95KWKVuGWHa1hwh2LyGJ06Pp/QnL rwT8aXXPPsxfoK3iDg56d1SG9aKFK8fbs1R7Qn+xPFKjGGN1oV/upXbe6PND6W9syRlv vTvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=PvDm6o18p5eO0SWxCbyfOmNYdKnWHShtEZV/Rr+hpA0=; fh=q/O78qJ+CjupVNxZmNAcb7DXyh5qMaqQ5AWBHRuXLKY=; b=YT99r1ODaow/9bT4LLPOql85ZGTDNxKcbnvwtzplMvRn3xJMzlf2HLvVj93WjcMY42 6n4dj99iCi0NJM+8lrgo01d9/HX4WPoj4aqOOV70Iz5Xi+Cvh1H2sOGcOFEp2YyxyERE 4DjxdUB3QB04D9a2yNrjadVSNS9qVOhy8LO8fp+dEE4OAc8/f2lKBn6OZyeVwKdviALH gsSfFq8a2di9MIlT/PiIutWxhOsTX/CAJLnuH9OGcuErifer3iD8ecJP8+LqZwGOnNVW mhnf+twjwTv1B6NrQcLuyN8y3VPCn2MkvhwyL3P5ZWyIKUDGZj+NjuUSZOjFlsWljkto KChw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=W+py6fgA; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-41566-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w5-20020a056402070500b0055ef5b57ce7si15022edx.555.2024.01.28.00.48.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 00:48:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41566-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=W+py6fgA; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-41566-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0E4121F22239 for ; Sun, 28 Jan 2024 08:48:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A7BADF6C; Sun, 28 Jan 2024 08:47:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="W+py6fgA" Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) (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 1DE6ADDA2 for ; Sun, 28 Jan 2024 08:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706431677; cv=none; b=j6pjNvthzkio7EDAOA1JrskrSt9SsvnABST5T0CUKBcoJ4WT+wLQRNSLC0cHUtWjwOFVn7ZDYEUWf0SGqEpamgYDdZEgzXj2XnXY/7tH50Xclu9v/ctuK9Qv6h7R1pKZx88PMzWOfTVWiDiCY0vxDCsC5Bt+zBsqRzTHJUp1dZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706431677; c=relaxed/simple; bh=aJw6AqhVkV5H+6qkrHrVvQkMiGIYDaRTkcVg98CSjFM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DRpe0ssOpaIEO/qkMIEA2/VCSAeHrTO6X7aySzUhwWBc4vrW6dJ6wlnB48H90r7Fkc0Boejv+x6LQWK82OYDpSsshsSkm7pKRIMLpdcRg/PVKoZY8ZuDubZnddheZolbNI2V3ysVaL1Rtqjtft/7+rkfSJNmGiorkzRuThyou6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=W+py6fgA; arc=none smtp.client-ip=80.12.242.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id U0pVr3FypwnxGU0pVrvuNg; Sun, 28 Jan 2024 09:47:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1706431674; bh=PvDm6o18p5eO0SWxCbyfOmNYdKnWHShtEZV/Rr+hpA0=; h=From:To:Cc:Subject:Date; b=W+py6fgAl++QyAGnzSJQDzXdfdUMFcFYkCcv8rH5F4Eg4+VXXpMT3kYKQ3mfhJEjS TaOSsATcd+8sYIuP+u+qulReV4NmA9genmKpQUU9DFEHDCk7mmr5gppFKDyRLZwOmB Jww+7z0j3FpXmbKGfgZ8Uy/oibBSwsoydYaL1OlRm0E13wUo1EoG3ApS5Iq4a9fR+T 3ff52tj4Liw18qCZqo1o5pweEvls3R8mJNcF3rOc4Vt43YpDHmFIx3QFhTx0r3nuQC IVRNADMv7qp6c0F2ANawb1j1jeNXC/+noCFxYTHTyhZ9zBzNvLv01BPFETpMiUgo7G nmBceHbN0Ez6g== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 28 Jan 2024 09:47:54 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Vincent Shih , Vinod Koul , Kishon Vijay Abraham I Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH] phy: sunplus: Fix a memory leak in update_disc_vol() Date: Sun, 28 Jan 2024 09:47:50 +0100 Message-ID: <451016052782f18c8b52ed0f836d7ab5c69bac3d.1706431643.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 'otp_v', allocated by nvmem_cell_read(), is leaking. It must be freed before leaving the function to avoid a leak. Fixes: 99d9ccd97385 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021") Signed-off-by: Christophe JAILLET --- This patch is speculative and based on comparison on the usage of nvmem_cell_read() in other driver. Review with care. --- drivers/phy/sunplus/phy-sunplus-usb2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/sunplus/phy-sunplus-usb2.c b/drivers/phy/sunplus/phy-sunplus-usb2.c index 637a5fbae6d9..50f1f91ac052 100644 --- a/drivers/phy/sunplus/phy-sunplus-usb2.c +++ b/drivers/phy/sunplus/phy-sunplus-usb2.c @@ -105,6 +105,8 @@ static int update_disc_vol(struct sp_usbphy *usbphy) val = (val & ~J_DISC) | set; writel(val, usbphy->phy_regs + CONFIG7); + kfree(otp_v); + return 0; } -- 2.43.0