Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp952468ybt; Sun, 14 Jun 2020 05:35:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNl5zhfN6LL/KZfG0LfvduDxQc50XUVaEWde7fMglz8Gv8hmJjKZOOS5duM2I9UJ/7rEIW X-Received: by 2002:a50:d75e:: with SMTP id i30mr20252702edj.305.1592138110994; Sun, 14 Jun 2020 05:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592138110; cv=none; d=google.com; s=arc-20160816; b=adhB60Z7oBGisZ4FdpB3sb5rKnPr/G1Oq1/sx5nO2I8UZJkCpMtxR7yn8k5oGgi5tL 2pJXV6wnkb6E7dIO59VBnJyWFqiE8flHCfhGhRPSu6CyaDwoKrON9EGonYuZZIYpcAlO 4ek6HmUkhE4Lq/rodwmH8H9nk0YL7OaIMbNMvqrJLHtP7lrgslNSLiSbmrOYF9FUMQLt gcuIrxe3KCe+w3Pr1N6A0HzeYjLUcqt4T64p/6MSFQzkO7/1EnFsLYDuEsCR8FKtC/TH qpVax/gaCHVoB2fR/cVEfOjLYFZrH/l3moHO7k2iWp8M9p3c5mKfO9VvsuNbu8G/L5zj OP0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SKIiGB83ddT4Ddf/URGledt63KwexOpATWhRUr6iZ8Y=; b=BfNmcakhq5TPQ6x0V0/92gjuSdVs9auhUPmhvIjJpDCjXBLFdGt/7NKl9i77/Z2xS6 lYPMw0IW/V6YSA1mvWmD7zMw5LyzpUoPpyIRNP24aFu6Olhd5Ur4eee6nq/mz3vHZCSw iEcWXJe8sXfAiEF/KJqKNvtW61+SyTNYSh0rsWvTs9Y3bb+hIXBcAbfMkbVJNTRHwCkP bTPQYYxfePrctaVtTy5S6JnrWfD2Dztn10Cs12lSlng7Rudri1+UN/bnHhtP5ijbGLhh 1olB57lAjuWpsXBxxCkLqnHitU6fN9nu6SrQE/on/XhvECZ4/5h4+bvjV3MJFtk11rSv 8fOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m0ZZIiP8; 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 c23si7598816edv.204.2020.06.14.05.34.47; Sun, 14 Jun 2020 05:35:10 -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=m0ZZIiP8; 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 S1727038AbgFNMc5 (ORCPT + 99 others); Sun, 14 Jun 2020 08:32:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbgFNMc4 (ORCPT ); Sun, 14 Jun 2020 08:32:56 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A09E9C05BD43 for ; Sun, 14 Jun 2020 05:32:56 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id i12so5581404pju.3 for ; Sun, 14 Jun 2020 05:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SKIiGB83ddT4Ddf/URGledt63KwexOpATWhRUr6iZ8Y=; b=m0ZZIiP8vJjqeB8WnbJwEX6O69bNRPk7jEScTtW6TX89Oy+FAJ/mGGk07lesh4fQTZ 7YE22lbg2t4tE+vwKb2bti/fWPeB1EWep/RB1+fdCFDtZPX2P6c9wDfOeeRt8yCKeqop 4y2aCD0b7R/aj1+FAGKIw8deDNDVCFBMqOQp/jmf0gYgII0OL2lRkcC0Xnp70KEUBUXU PhOWDL7AsPSUnPCU5xDaAXzdNsGBkKEgDmutmXqTMwfv2rGIJ/taO9TN8+0R3VjbwPju A+fjhYOxwZ26uVnFCSMoqPFceK/RBPXs2X2OgG4JL1/Pgxa52k0Bh+/5RVBqCSK6R4r1 UFiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SKIiGB83ddT4Ddf/URGledt63KwexOpATWhRUr6iZ8Y=; b=Z9DfB+PQwb2tmwzRIP4HdLdMMeNtwDmxa6yF/PneOs18u8SjW37kndy8LZIE7sy+EH PV62s/JPPzovlSFijQtr4w+S+CnYRtmpjV08qKnzFYaa6NEMETz+ig+U5Ijyl/nUVLyw XzlIzVMPB/f+C3izY+66umyY52MKh4tPWNvPnb8VXIZ+SoFu3h8HxFixw05XqsUmpTTf 1Kfo4r+ToityjiZ6V9fisyxOrVr4QMN1or917JejkuKZgn4uopVOYASw+aWK6/ZfvyK5 Xj1ACx1OYoIVCFpweJTFGLDgjCmaxMZZ40RnBa1c3Din4db+UmIAEL4ihEUBYH/YakX2 75gw== X-Gm-Message-State: AOAM5322Nly8GOgJRO5LWkUaaxzyym9Lj0/coX8DUoruTItFBEhDltnq 7kV6AexOZcmCjsTEJ2Uot4ZiMaSDwvCugIrG1/PCHhsvwNE= X-Received: by 2002:a17:902:7288:: with SMTP id d8mr16491452pll.18.1592137975872; Sun, 14 Jun 2020 05:32:55 -0700 (PDT) MIME-Version: 1.0 References: <20200614065251.94106-1-navid.emamdoost@gmail.com> In-Reply-To: <20200614065251.94106-1-navid.emamdoost@gmail.com> From: Andy Shevchenko Date: Sun, 14 Jun 2020 15:32:39 +0300 Message-ID: Subject: Re: [PATCH] drm/vc4: fix ref count leak in vc4_dsi_encoder_enable To: Navid Emamdoost Cc: Eric Anholt , David Airlie , Daniel Vetter , dri-devel , Linux Kernel Mailing List , Navid Emamdoost , wu000273@umn.edu, Kangjie Lu , Stephen McCamant Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 14, 2020 at 9:55 AM Navid Emamdoost wrote: > > in vc4_dsi_encoder_enable, the call to pm_runtime_get_sync increments > the counter even in case of failure, leading to incorrect > ref count. In case of failure, decrement the ref count before returning. ... > +out: > + pm_runtime_put(dev); Better to use pm_runtime_put_noidle() for error case. And here is a change of semantics, i.e. before your patch there was no put at all. How did you test this? -- With Best Regards, Andy Shevchenko