Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp68129ybk; Tue, 12 May 2020 15:36:34 -0700 (PDT) X-Google-Smtp-Source: APiQypLQm2SO56pKaN98Mjur/rPnkEnYOCGPZfE/EiUs9yVGU8T9VnVBkCTt/o/XgTvPPo1TEdwT X-Received: by 2002:a17:906:ef2:: with SMTP id x18mr19320744eji.234.1589322994698; Tue, 12 May 2020 15:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589322994; cv=none; d=google.com; s=arc-20160816; b=LTHk4lby7vbhj/vkJd6eit1rUKvjIhwwiVoOmyQDr/oBBVX/gv0COJEdVBZtdhVvl1 FfAunlKzY1gZ42wXmtcLHSy380/roK/TG1YZbV6az3QHASbSGHkDEFJ0e0Af9Nk/6ODu ZkngeV7Wn8ZaAlW+0emvqAQVYGxJHIHoPg+J4XkMKT20oAx2tJh4jhRg4AMxunZ4VCC0 hXxl1caiCGX09y+WTGNQ/t+LaHTPTF8lSoltYHEccPjoiVrmvzv1aZC5ys32uhT1Sd5V qySDZTy4h/2+mWvQMl8QUBU+MD0mPhvbbXjqjGVoegw+HBADzJPHtH85NEAwS081a3j4 EvDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=3ugvWoqg/lnqSOzrqbs265mhUb7y5WZ0/Kg5tetY0Ks=; b=Cz+lY02oxAhy+THkwJs3+CB5wSzoHVDQFOnekJ374x8zhBuR7x5i1QBz06d4n/033Y h3Tqt/7A5GQ7xlYSehozlzy0rNINXntA3GzjmuAK02+DwzOiWa+uA1Sy5sydfb8qx23P XQL3uB1riftmrmkFmMdJgU4EavQsjolZT+LGlA05jtnOcTtORZ9I2VS6fTDLPJUkTdT4 PKPa5sNLZ0McYAnQstQ+mtgNhm3IO2+jurVekG3ZoGOLD6AnOdatYDwKyGgEfFEmMfLa i+/rnZPlPekKtoPpaLmrk4f6/T22seV0M7uZ2iJolF2Y2ZZnK0Jq187+hDw8MoY5mxQI 7Msg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si8729679edn.565.2020.05.12.15.36.10; Tue, 12 May 2020 15:36:34 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731320AbgELWbs (ORCPT + 99 others); Tue, 12 May 2020 18:31:48 -0400 Received: from mga06.intel.com ([134.134.136.31]:25447 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728882AbgELWbs (ORCPT ); Tue, 12 May 2020 18:31:48 -0400 IronPort-SDR: Mpm2tyBtMrfgdAZOGe+NJbBaY9ENyEst9D4s3Ka3kx0dHLSqCpWuAHQx2OJ8US+4qOQHV4QErY nb7e1Ne+vjaA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 15:31:47 -0700 IronPort-SDR: PkKMECiNmvqqPI4TDZD5CIFKF391voNoPr2ze+x9t+fvBjQJK13e5+G4jVhLoyziseMrRMYcyz jsJ7LlMf6V9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,385,1583222400"; d="scan'208";a="463709859" Received: from twinkler-lnx.jer.intel.com ([10.12.91.155]) by fmsmga005.fm.intel.com with ESMTP; 12 May 2020 15:31:45 -0700 From: Tomas Winkler To: Greg Kroah-Hartman Cc: Alexander Usyskin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?UTF-8?q?=E4=BA=BF=E4=B8=80?= , Tomas Winkler Subject: [char-misc-next] mei: release me_cl object reference Date: Wed, 13 May 2020 01:31:40 +0300 Message-Id: <20200512223140.32186-1-tomas.winkler@intel.com> X-Mailer: git-send-email 2.21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Usyskin Allow me_cl object to be freed by releasing the reference that was acquired by one of the search functions: __mei_me_cl_by_uuid_id() or __mei_me_cl_by_uuid() Cc: Reported-by: 亿一 Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index 204d807e755b..b32c825a0945 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -266,6 +266,7 @@ void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid) down_write(&dev->me_clients_rwsem); me_cl = __mei_me_cl_by_uuid(dev, uuid); __mei_me_cl_del(dev, me_cl); + mei_me_cl_put(me_cl); up_write(&dev->me_clients_rwsem); } @@ -287,6 +288,7 @@ void mei_me_cl_rm_by_uuid_id(struct mei_device *dev, const uuid_le *uuid, u8 id) down_write(&dev->me_clients_rwsem); me_cl = __mei_me_cl_by_uuid_id(dev, uuid, id); __mei_me_cl_del(dev, me_cl); + mei_me_cl_put(me_cl); up_write(&dev->me_clients_rwsem); } -- 2.21.3