Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp408081pxu; Tue, 1 Dec 2020 14:30:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwINsOqGMdM2mG9J66jnLD1KV9z8spyUJTOEfmFQQM0r7JseK+TBdn9qSR1URh3/Bby+hog X-Received: by 2002:a17:906:71d3:: with SMTP id i19mr5150935ejk.187.1606861858854; Tue, 01 Dec 2020 14:30:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861858; cv=none; d=google.com; s=arc-20160816; b=PFWP2gxiPsZ8jJ7yF317N6bdb/UJ6LKcLGRt10uCq61u2K3BcnbmNTpcpdPy3hSHoy FnnDhYjWTiRC7kJ/8Y80TZmlMKIcG3kNX+YCMDWN0fcMkB8lpGohr6srGCD7zkyAcLhQ /ncmSPuE0feBPF5fWzMSyXhC+stbMnOlak3j0dGUGYvUiH4G5aRusCikjdiBS1WOdQOp IoetFhxbKtB+GDAIdogcBwGe/uva3aFUF5FhIdBvSwrS3bJcOmS4768uehlu5yUqlRhV w0tW/0uJylxjxNU+5RMT66Y+PVAZB1HFQYnpjxVHYkC26nptRYhxtQnFmvKSRyt2MbWU 8J2Q== 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; bh=AcG+wRUR95SiQ/GtluhMwqUWb0yAB/TOxxco2rz5GTw=; b=05ogACBKDJprNKkGE4vBEs1gv8Or8bKXAtqeL/AoESJaQpFZexNYl2G4XSV99zg91J 2IzY9gWcmatZR06eLw6G/HSoL8hLq3IfxxpkH5eQDn4yxPOZuqr01TVseejNtD+FRFet FfgxUpc2s3I8jYh1fYIY6GNbHwZrfpRxTu1soN7d6H5swQ6Jez5m32quGjlZ0Bv+jqOd /pgEza8D2fElkphFxD+Zx2WjNA8MUblrXFTguE4Oo20FaVQHrXuwCjcqq8naAinP9axe XXQUk6VUpgXfo4ERTJra8A+mLrVQPa3aZpjQYQRLgOXi1yoyw64OydXv6rCKXYBlwLTW dPcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m17si825596ejq.464.2020.12.01.14.30.36; Tue, 01 Dec 2020 14:30:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390712AbgLAJW3 (ORCPT + 99 others); Tue, 1 Dec 2020 04:22:29 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8222 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390682AbgLAJWY (ORCPT ); Tue, 1 Dec 2020 04:22:24 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Clc6741BSzkj6p; Tue, 1 Dec 2020 17:21:03 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Tue, 1 Dec 2020 17:21:26 +0800 From: Qinglang Miao To: Michal Simek , Dong Aisheng , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Oleksij Rempel , Vignesh R , "Aaro Koskinen" , Tony Lindgren , Orson Zhai , Baolin Wang , Chunyan Zhang , Pierre-Yves MORDRET , Maxime Coquelin , Alexandre Torgue CC: , , , Qinglang Miao Subject: [PATCH 0/8] i2c: fix reference leak when pm_runtime_get_sync fails Date: Tue, 1 Dec 2020 17:29:24 +0800 Message-ID: <20201201092924.112461-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_runtime_get_sync will increment the PM reference count even failed. Forgetting to putting operation will result in a reference leak here. Replace it with pm_runtime_resume_and_get to keep usage counter balanced. BTW, pm_runtime_resume_and_get is introduced in v5.10-rc5 as dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to dealwith usage counter") Qinglang Miao (8): i2c: cadence: fix reference leak when pm_runtime_get_sync fails i2c: img-scb: fix reference leak when pm_runtime_get_sync fails i2c: imx-lpi2c: fix reference leak when pm_runtime_get_sync fails i2c: imx: fix reference leak when pm_runtime_get_sync fails i2c: omap: fix reference leak when pm_runtime_get_sync fails i2c: sprd: fix reference leak when pm_runtime_get_sync fails i2c: stm32f7: fix reference leak when pm_runtime_get_sync fails i2c: xiic: fix reference leak when pm_runtime_get_sync fails drivers/i2c/busses/i2c-cadence.c | 4 ++-- drivers/i2c/busses/i2c-img-scb.c | 4 ++-- drivers/i2c/busses/i2c-imx-lpi2c.c | 2 +- drivers/i2c/busses/i2c-imx.c | 4 ++-- drivers/i2c/busses/i2c-omap.c | 8 ++++---- drivers/i2c/busses/i2c-sprd.c | 4 ++-- drivers/i2c/busses/i2c-stm32f7.c | 12 ++++++------ drivers/i2c/busses/i2c-xiic.c | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) -- 2.23.0