From patchwork Thu Dec 7 20:10:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 175368 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5036846vqy; Thu, 7 Dec 2023 12:11:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IEN9F6XDWiibItObqL0fYztB+2mcvWhG9U69yWhgczvU/QF+A0qdfq0YhTXHcSp9rVsKI5L X-Received: by 2002:a17:903:2448:b0:1d0:94fa:b3f with SMTP id l8-20020a170903244800b001d094fa0b3fmr7350787pls.61.1701979874715; Thu, 07 Dec 2023 12:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701979874; cv=none; d=google.com; s=arc-20160816; b=dOXaKftBPZoRgypnxizUZ8behyY3Aw9fxdjeU4hy5hRNxBUf3YpbFae8S5wyf1AoWC PuH2uTC8sec5SoVhjLx91AFikgqsta4X5AAq8HBLFcyFe5nJKHVnHNj/G16KH3A5cnrd 7rPjDhK+aIilBjkxNGOwKSYBUB7nGSYET5JVpCLPs/CdU/C9wjw30OsakBDBatobzibf OE79MLUIVxWuoWPC/mNNCkLf8dMAPSqCAC0RG/ASB3EC5OEgdPZ4L3ZUvxhMhdTvMynU f8Nwn3e2yruWJBgFiniNQ9NUd8jGC7R0fDbQqVGAcRJWnxFp7ruMjugoE1GwrglchNpp IFtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lrqiH8yVpgT6zM5oRkE6GFJPks/LuoT9ILt/fdADS18=; fh=Bo9rzUMEbbsrr+A0uUeo9kyebP2VqMZj019klnr0tQo=; b=xkopNKodf8GvoRvQxcTFcbbWqinaGzTkuU+O5y851T7brECfD0VpPuM59LDo5qiy3Y SP5yrAHR6IT+aNWM+e+gTD4+afdLTvfDWDz1ujvHlWoWsEoavdpPiVAB/FzqLwiFi8Dx simyEoiYqXFFCUskthlKyMYmJ2bvQ1VYjX4Eh2DBJoWim0b/2GCCt+LN94Ar9D29oE8T Xmc/ol1mtQmTiwSrbrXK1qS0S2Egd1l/7kGR2lzR0qWRBZSL7qnp1YFy77IMwlgZjuFm 9aj6rNwxSTA1yxYnsyetfHvH8+iD3HIiH0ZuzBSPwEitUhXqZpb8ZAlYzCmXKKcA7KUS geHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=VZSPcQ9Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l5-20020a170902d34500b001cffca2854dsi260214plk.309.2023.12.07.12.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 12:11:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=VZSPcQ9Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D9F6081489E8; Thu, 7 Dec 2023 12:11:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbjLGULC (ORCPT + 99 others); Thu, 7 Dec 2023 15:11:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjLGULB (ORCPT ); Thu, 7 Dec 2023 15:11:01 -0500 Received: from smtp.smtpout.orange.fr (smtp-29.smtpout.orange.fr [80.12.242.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 780CD170F for ; Thu, 7 Dec 2023 12:11:03 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id BKi4rWEPVrKXzBKi4rMu75; Thu, 07 Dec 2023 21:11:01 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1701979861; bh=lrqiH8yVpgT6zM5oRkE6GFJPks/LuoT9ILt/fdADS18=; h=From:To:Cc:Subject:Date; b=VZSPcQ9YfoGsXgnmIKwNY2isHZdBmuBhN9Bl8vEIAFMUqL1O15e1YjavF1euIk1zS 4A0GXrQhsoupjVxjO8I3pyyGagDU4Ga03RrLDbc2N2mM2wYyqcQB60YFrzpOU8RTZS s5BJ0ryxAYDsANJb0IRoZzIYFX8Forzk1vnJvyLB7GIutwow89eM0hA9sC7iHIvMB6 i89qbwBxrvEyL9a8k+3PtnzgKpDLf1uv1CnQM9cmnGotx3CoJTdc88CgV3L2eKAAzL 0yvqEprB95WoIP2q1NJTijsBhck/lq0yc7vUBAMQ9cfA4CPiUioBfdiNcvwdhORo5L 2fImSgAiB6nmA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 07 Dec 2023 21:11:01 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Antti Palosaari , Mauro Carvalho Chehab , Brad Love , Sean Young Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH] media: m88ds3103: Fix an error handling path in m88ds3103_probe() Date: Thu, 7 Dec 2023 21:10:56 +0100 Message-Id: <32237b89eef582a89f64c4f6213e27d99245bafd.1701979842.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 07 Dec 2023 12:11:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784655249000867435 X-GMAIL-MSGID: 1784655249000867435 If an error occurs after a successful i2c_mux_add_adapter(), i2c_mux_del_adapters() should be called to avoid a some leaks, as already done in the .remove() function. Add the missing call. Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod") Signed-off-by: Christophe JAILLET --- 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 26c67ef05d13..e0272054fca5 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: