Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp365111ybz; Tue, 21 Apr 2020 10:29:04 -0700 (PDT) X-Google-Smtp-Source: APiQypKF2k/ELdRVuaPDPkERFKMoCl2wbbHw+hB+5PE94cFbJorYJHqIcsLMwZN5+e2Whj/4KivK X-Received: by 2002:a17:906:5fd2:: with SMTP id k18mr21707315ejv.243.1587490144505; Tue, 21 Apr 2020 10:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587490144; cv=none; d=google.com; s=arc-20160816; b=Kh84IWowu//8hwW1Mt3SeL8XGG/ITtn8UqHSDyZrH/Uf2eslzH6bob0H2waolVG9XV GiN5LDt8dqsuvapmXn9g8hwSpJ6hSqiyxql0k67JycrY0bm3SfuuPO5htUF423sOB/f/ 6IpTxaye/AXawQHG9qwHAlyzpxjnDXwSgCQVquT4esO8EojBrocJP9IeIXwqX4zlmj21 9VPG7A9KqmU+Op1vX8w64SBvGWvDNOL8dzOO55Yd+8uekS8RxhN/GD1teCCYblGijHuX ImWyGQ7tdMqqi/W86uvuZ7cqMpxQhRcpf40gEEcBP/YPzWuVNbi31IvqhOdLMBr6Z4ZS 61NQ== 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=L2/tuyyrk+FrC+TVWKAO9Jkv7cmo4/vzdDOJ54GNqZ0=; b=zLzCDvjiv8cIU968RGs2gAJhc+iQrp/jZ1d97LkHcf2pv06Of+HolUmNHjtGIQP5Ob 29bM1GkcxGJmhQ/4VWUhQ2B0o+jgNjyl4uH9xt/V/XsfYRzfKQsYQQyYdIoIoGu34BL3 2ciWK8AhdduBAhpkqnjly+EM3lCSHnQsZSkN1UpeN9TsamOjsA6uULghhDx6vGREWD8J U7wsxXF15BwKg4+J3cnwBbo5yAdgoWR2EkJ4xRUtcPwP5gZ4E+RFkZJuOlNlE/PVRv4g 5RzXGQZeEdWGPDuTNZdVwEVOyLKHvwNsveroHEHh8DlaoK5GWykz7Njam4NHInALD3cF eI+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IWpewJSy; 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 s14si1770793edw.490.2020.04.21.10.28.40; Tue, 21 Apr 2020 10:29:04 -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=IWpewJSy; 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 S1728479AbgDURYe (ORCPT + 99 others); Tue, 21 Apr 2020 13:24:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725930AbgDURYd (ORCPT ); Tue, 21 Apr 2020 13:24:33 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C960C0610D5 for ; Tue, 21 Apr 2020 10:24:32 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id f8so5496064plt.2 for ; Tue, 21 Apr 2020 10:24:32 -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=L2/tuyyrk+FrC+TVWKAO9Jkv7cmo4/vzdDOJ54GNqZ0=; b=IWpewJSykrsnWxN4K46c7BXyiKGU5U5+mh07wYceXa0O/DjBweXi+37HQV6tvxior8 HDFIvxDRQZvnytbETu4ORlFbuLNAvRUZK06E6ocYW7wZu3MO0ot/BhZfVywbZG5Q50QL uhYIs5AGh2Ws5lc7HIcAFax5orO6IPLEuQ4MUp3tO8d9xZqSM/jnmzB2XmrdyBBMlzBA Nc+q2c2kebrbl7Q0mknsP2gTP5mwFdo5px3V0KHY+UtIh9rPfDAMM4hb/JVZj9ZdEujZ 35nYpMtceYIjgLbKPL5kiaQ0fbIdc4SA15dZZhg0NguR4NdcLqUIeGKiT7WOdc3yeyJx 14NQ== 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=L2/tuyyrk+FrC+TVWKAO9Jkv7cmo4/vzdDOJ54GNqZ0=; b=XAk1T32fkxmBx7GUqJHfndEnoqlS4BT4ru+rhYvTXl7hrs7HjMCAbOL50Aa7Fil5Q9 Gaoft2EluUbWu2miJbyYzn+fp9ePbdQwx21714YwmJ7IK/JiT4LG0OGdc8EbVC7hkdw6 b59EJHBzbpuBzkx9iUFvXaIPAUGcghl8ykteUWrlOplaGMz6TDVedR53fasgrAxShtRr QicTawOsLBobfW3L/KC/HibB9/difcBsAYoVjgA+xZEpIaahpe4oRCGpfRN8/a7fOgol w8nLYWAYH/+FtBp9CAmrqXb2MZEUyz3DmBTmLlpoIi8KKD3PGAaoMfSks+1Nn0bo1H9M xtVw== X-Gm-Message-State: AGi0PuaKHNK95k6C8VvsPeKtF3imdhnkbf2nXDpgawiAGmizFn/F239i WPI78TRcbSgpQL7MVEYj7l6kxwzj5VPgvjPxNGw= X-Received: by 2002:a17:90a:2401:: with SMTP id h1mr7010141pje.1.1587489871604; Tue, 21 Apr 2020 10:24:31 -0700 (PDT) MIME-Version: 1.0 References: <20200421164543.16605-1-zhengdejin5@gmail.com> In-Reply-To: <20200421164543.16605-1-zhengdejin5@gmail.com> From: Andy Shevchenko Date: Tue, 21 Apr 2020 20:24:24 +0300 Message-ID: Subject: Re: [PATCH v1] drm/bochs: fix an issue of ioremap() leak To: Dejin Zheng Cc: kraxel@redhat.com, David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org, dri-devel , Linux Kernel Mailing List 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 Tue, Apr 21, 2020 at 7:45 PM Dejin Zheng wrote: > > It forgot to call bochs_hw_fini() to release related resources when > bochs_pci_probe() fail. eg: io virtual address get by ioremap(). Good start, although I think the best is to switch this driver to use pcim_*() functions and drop tons of legacy code. > Fixes: 81da8c3b8d3df6 ("drm/bochs: add drm_driver.release callback.") > CC: Andy Shevchenko > Signed-off-by: Dejin Zheng > --- > drivers/gpu/drm/bochs/bochs_drv.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c > index addb0568c1af..210a60135c8a 100644 > --- a/drivers/gpu/drm/bochs/bochs_drv.c > +++ b/drivers/gpu/drm/bochs/bochs_drv.c > @@ -138,6 +138,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, > return ret; > > err_unload: > + bochs_hw_fini(dev); > bochs_unload(dev); > err_free_dev: > drm_dev_put(dev); > -- > 2.25.0 > -- With Best Regards, Andy Shevchenko