From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8271463122; Tue, 23 Jan 2024 00:53:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705971197; cv=none; b=fQeEEXI+3RHJ9K16HYVwXL0ls4cL6orNPS7g0v6H3qwoAtnFEQI2V4xZtKqF/l/s+6bBEDfBYvPPz6HhJJzGYayxbX1xGt8b/Q+cJSUWcbC0R7xVxlyjYXhrbWv3ZRSv1E47FEL+BnzT+o/iGi8xieNO5W+xZJTMRtt1u2qv8HQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705971197; c=relaxed/simple; bh=kP9SJIHo6RfJL665ypiiGzTz72ez0UkkOWUSQgzU8oo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rS60SHXNWr8v1x4IB0noZqU1qzA5WE/UJIX1YvGmmsDiQVLrn3M8/WQ2k4B8tFTWdj2WNbTbWp5HO26nNxv0evijc9SLm8W0t2mLd7Wad+FXOGhNuf1i4omJ0FQBLPXD5SBf1W1foD9h50X3iux7rs6JjDLvjAwbbWq6FPi1b2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bG8Ow9Kz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bG8Ow9Kz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4112BC433F1; Tue, 23 Jan 2024 00:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705971197; bh=kP9SJIHo6RfJL665ypiiGzTz72ez0UkkOWUSQgzU8oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bG8Ow9Kzj1v3IvO9G+gPCTXCHetQcIouqOhbDQMiE3i+eaOV0dndsRKpo6SwnfoCc 9QTMw9yFle1VJu1cwnh134ilompxDEBOrLtUaqphr/4yAvHw/nft1LY6wxd9+NP3z/ E5JoLqosbSa+34n0HfwRCsxuLSl+E3vI/hBc9zhQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christophe JAILLET , Hans Verkuil , Sasha Levin Subject: [PATCH 6.1 202/417] media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe() Date: Mon, 22 Jan 2024 15:56:10 -0800 Message-ID: <20240122235758.929456472@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122235751.480367507@linuxfoundation.org> References: <20240122235751.480367507@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET [ Upstream commit 5b2f885e2f6f482d05c23f04c8240f7b4fc5bdb5 ] If an error occurs after a successful i2c_mux_add_adapter(), then i2c_mux_del_adapters() should be called to free some resources, as already done in the remove function. Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod") Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/dvb-frontends/m88ds3103.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c index 9a0d43c7ba9e..ce99f7dfb5a5 100644 --- a/drivers/media/dvb-frontends/m88ds3103.c +++ b/drivers/media/dvb-frontends/m88ds3103.c @@ -1894,7 +1894,7 @@ static int m88ds3103_probe(struct i2c_client *client, /* get frontend address */ ret = regmap_read(dev->regmap, 0x29, &utmp); if (ret) - goto err_kfree; + goto err_del_adapters; dev->dt_addr = ((utmp & 0x80) == 0) ? 0x42 >> 1 : 0x40 >> 1; dev_dbg(&client->dev, "dt addr is 0x%02x\n", dev->dt_addr); @@ -1902,11 +1902,14 @@ static int m88ds3103_probe(struct i2c_client *client, dev->dt_addr); if (IS_ERR(dev->dt_client)) { ret = PTR_ERR(dev->dt_client); - goto err_kfree; + goto err_del_adapters; } } return 0; + +err_del_adapters: + i2c_mux_del_adapters(dev->muxc); err_kfree: kfree(dev); err: -- 2.43.0