Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9127447pxu; Mon, 28 Dec 2020 07:17:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQ6C2L4lQVz9OGD3kg6y2Y12inPkHzqsDDtvnEbFpWOrZ0uNB6eLLl4djqyrLVqkK9kAkC X-Received: by 2002:a05:6402:1102:: with SMTP id u2mr12410766edv.18.1609168645370; Mon, 28 Dec 2020 07:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168645; cv=none; d=google.com; s=arc-20160816; b=eSY+JjjwrJuGWyajMPFcwbLh2r80uvW8ZDNudIrUFv7HiBbKOfSoOKrOu4SRtqZ0Jo HemXUTn/zyd41tJQwdMVyjw321I52dmDxwq1xvUXNahr8KFLebslV2ET3FmKZFWFhNKM taLemaVbkE4IrJ+fRvQgdAzk8gOAPSGU+rzX7PNz6RPcJT6xbG8bTDZEg55p3At3eaJ3 x2n1dXmq4ADpvYGt5GbmLjrdj/kvhirKc+00uZgr6q6u+mi4mWVUGJqwUCRz2o3vYRam nsEocn+HAxXwUNOvzi+z/dEvNXaIoOUL8WP0X2CKqwcqIul1vjWy29y/tS44En1tKU/I u3Zg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MvkEOOHX6D0ZhC4oItLUcdE7p0MRkjMLD12XC1cJEA4=; b=HmNw9RIhgmBPsu5IWFkMyczR3GDaD29KSCT82DTJ31B4zuDTZD7+/RUKG5O2Z9x0wU 8LJ8nuhBd9Wy3PFaVzEK+8Mpqm3AqEgtGN3iZ/hS6gnStQ8UK0NaeFIpjYByXNzIgcYX gRWAEcPpikBUPgusbF3bk9kXZQldyj2qS6GITKgrWzpbn1cqyhzMJq8oOMXZ6d/Pd/cw 0Ilo+fK6VoUwsYUhXrXrLdBb2J6Bot9NpgrleTS07QEmlMshp5qazDvtPJu4uRenlhlz euDeiZ08T9teXEf3Dfa86Dr6hhHV/ljwPnwuDEFDT2R5UZSVJmGnJUsbCUs1qUEA5bbW zAow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tWG5E3CF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x17si22676577edq.181.2020.12.28.07.17.02; Mon, 28 Dec 2020 07:17:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tWG5E3CF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441138AbgL1PPA (ORCPT + 99 others); Mon, 28 Dec 2020 10:15:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:40882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438164AbgL1OGd (ORCPT ); Mon, 28 Dec 2020 09:06:33 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BEC9F20731; Mon, 28 Dec 2020 14:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164378; bh=GupfwFL5yEdxBwnR6c/CMKU4bl3wnHCOEcGxNo179u0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tWG5E3CFB5EivMP6t5nwEr7bKfn0jhdGfu+1mGvnVxmzvR3mwrxqjdi8dC5pfoM7C wgp/P6Cdg9ptqq1Ny815pZjO7pmGDzUrYIojSlzTF/9bkrQKGgizzblZlLLykkMMsV HtEOQBccWyiIOIaumeGy9O15MfEReqWNdLe4cKzE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jing Xiangfeng , Lee Jones , Sasha Levin Subject: [PATCH 5.10 160/717] mfd: htc-i2cpld: Add the missed i2c_put_adapter() in htcpld_register_chip_i2c() Date: Mon, 28 Dec 2020 13:42:38 +0100 Message-Id: <20201228125028.622081874@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jing Xiangfeng [ Upstream commit 9a463284706c5217872c3cadaca863d47129bd95 ] htcpld_register_chip_i2c() misses to call i2c_put_adapter() in an error path. Add the missed function call to fix it. Fixes: 6048a3dd2371 ("mfd: Add HTCPLD driver") Signed-off-by: Jing Xiangfeng Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/htc-i2cpld.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c index 247f9849e54ae..417b0355d904d 100644 --- a/drivers/mfd/htc-i2cpld.c +++ b/drivers/mfd/htc-i2cpld.c @@ -346,6 +346,7 @@ static int htcpld_register_chip_i2c( if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE_DATA)) { dev_warn(dev, "i2c adapter %d non-functional\n", pdata->i2c_adapter_id); + i2c_put_adapter(adapter); return -EINVAL; } @@ -360,6 +361,7 @@ static int htcpld_register_chip_i2c( /* I2C device registration failed, contineu with the next */ dev_warn(dev, "Unable to add I2C device for 0x%x\n", plat_chip_data->addr); + i2c_put_adapter(adapter); return PTR_ERR(client); } -- 2.27.0