Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1930368ybj; Wed, 6 May 2020 07:48:44 -0700 (PDT) X-Google-Smtp-Source: APiQypL4ERtu82/l36NE22OT5b1H5kQxaxLUsk0dIFfsfKohhA5djqC+rd+CF8GdAxdT6tvbkKlc X-Received: by 2002:aa7:c0d2:: with SMTP id j18mr7403665edp.283.1588776524121; Wed, 06 May 2020 07:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588776524; cv=none; d=google.com; s=arc-20160816; b=ao/ZOUKed2xsBGBlw28aO68M+UyLM0lG7atSE4iQxJ+ah+TB2gnL1iD90+tGhNbdhx 4j4Svovbv5p20ZXFBIYjGicPg+WDaTJr/Xp1RFIZorg0dVJ6plJiy2isxiLSKR18n54v sROFdbBC5sohZHJuMn7pIctLS3rEGeNP3qjNKuNX6+kxjDEzxd4dpUHuXlB7/zvSsTPp Fx9JJBNGHusPTjMEMYWDsiAXj/FWG3rQ2sccJAPccNNcf7GPOLbLH5FZwKwN1Y7NLeuX gIpBf8qAG5uOQsYn6VJFP7y2RTkr7G5yTL3IbCw5aLaaG0+qik77zvt4Z7WRrgygL5BS /lYQ== 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:cc:to:subject :message-id:date:from:mime-version:dkim-signature; bh=o3F+DLGNtLRj4YOMWT2oFX2YAo4Us11+uegbWGPGt2Q=; b=rsbRtPKIl6Z8fvaRDp0JVkztY9drG9jFnvWcmVJ+FcrBtDLq07+QLoANwGikq8G7C/ WjXZVBk9nM05mhZhzajiALPGKbzgg8aU5Gx6mo45uT0EwWvKhwTmi9RIa8J1MfxIh/ET JURY4o2XCyEyaqaTkG/PNjw+ScqvAApHcYZoThAJMPklJsUmkHAftHk3csvcq0FepSJ1 vreYM8ZUT1pCd4Vp9eV+U4GA59Xd1CO95SM8/1k0IzZ0iyIC5o/EPb9sz+70bZLw2jzG q6AEhQN74ZVBek48W1m0zoDrurgbKmkIBKZjZQfbixaUu47ECflW5b8sGYjmCmH5oalq Pw2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=usD4QQNj; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si1182785edl.247.2020.05.06.07.48.20; Wed, 06 May 2020 07:48:44 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=usD4QQNj; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729162AbgEFOqz (ORCPT + 99 others); Wed, 6 May 2020 10:46:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728712AbgEFOqy (ORCPT ); Wed, 6 May 2020 10:46:54 -0400 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BF2BC061A0F for ; Wed, 6 May 2020 07:46:54 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id z17so1553232oto.4 for ; Wed, 06 May 2020 07:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=o3F+DLGNtLRj4YOMWT2oFX2YAo4Us11+uegbWGPGt2Q=; b=usD4QQNjpMxIAnHFM0L1oDYKTavN3mOhnpDw2CvZFL03GQ8nrAmCS7Y/2K6cL9CjOD 3sasUiqheTwPHVsm3vgDzVijA/kClx5HVzEGDLt5ziQAOXmukLjxZJIYktSttdDH5SgQ 2lXjeh8e73qP93ufvvo5t2sU/9ISlnLI9E2mxysanX25SCh41AW1gC0OJWoagypAKX8I zNKCVmROn1sZmRyIApSuQamPyYOd4dLdAooXfGn7cJvJnpMW0fhxxG/94x6TrpaOJn7y yJ/2ptbDPTQXojGgtPTgQVHiYvRzc8K9MZpry6jxKjT2EZiB482qaOrZbMk2YLwb3ahN LOpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=o3F+DLGNtLRj4YOMWT2oFX2YAo4Us11+uegbWGPGt2Q=; b=dYUzJ3Sxb5+vBUVCmS770KQHdjlIcZII3N83ShuWnb6Qzue2CJUSa+jvappI/dTEET 2T3tabSMP2ssBuiZpqOjJxGGnDYuedBpKA2LX+esXg5RjvH+tOI3vIjQ7DRTE7fwk0Ww 8R8M/em7F6rcjgkygBQuvPRi40y4NJ6MQ91kIW+cc7Ml2tU5utx/+xrg6ErcU/FLQbgd vPDEqn1/gfUwvv0NcxpeXtl7hzsnbJhBTFNSj3LX3ug/lry4ZxTqZ6D7kl3x5Z8R3MI5 d38+i36SXa8xNtyR2k7vOOhv1qgb0GTiZhsXP63AOitoi6yPK0n2l5N3p1P6Vchg2P5S zMvA== X-Gm-Message-State: AGi0PuadHuJBdhatHNyg1pXVKBFlodAfmBbWuZ78x20QsZqIMSP/gzYK kKO3bBrlicpkMgRhySeUn+YLsUSKj+0DIOWUzrw= X-Received: by 2002:a9d:355:: with SMTP id 79mr6336463otv.275.1588776413921; Wed, 06 May 2020 07:46:53 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?5Lq/5LiA?= Date: Wed, 6 May 2020 22:46:42 +0800 Message-ID: Subject: [BUG]is there a refcount leak in function mei_me_cl_rm_by_uuid? To: tomas.winkler@intel.com Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI, all When reviewing function mei_me_cl_rm_by_uuid=EF=BC=8C I notice that functio= n __mei_me_cl_by_uuid increases me_cl refcount and function _mei_me_cl_del delete a list node with decrement me_cl refcount , actually here cause a refcount leak as we haven't release the refcount by __mei_me_cl_by_uuid ? similar issue happens in mei_me_cl_rm_by_uuid_id too. void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid) { struct mei_me_client *me_cl; dev_dbg(dev->dev, "remove %pUl\n", uuid); down_write(&dev->me_clients_rwsem); me_cl =3D __mei_me_cl_by_uuid(dev, uuid); /* increase a refcount */ __mei_me_cl_del(dev, me_cl); /* release the refcount with a list node deteled */ up_write(&dev->me_clients_rwsem); } Best regards, Lin Yi.