Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp771555ybz; Wed, 22 Apr 2020 07:43:58 -0700 (PDT) X-Google-Smtp-Source: APiQypKwTdgRy/5ecT8QqPnjN8+9bIbBFZfp/4en7DjK/HnlNB8F8k+IMjOgvA1Ma5Jj2Tb65Sj0 X-Received: by 2002:a17:906:15d4:: with SMTP id l20mr25938199ejd.91.1587566638486; Wed, 22 Apr 2020 07:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587566638; cv=none; d=google.com; s=arc-20160816; b=CAuYUcpvB8TbpPko9+eviGoxt0LDEyehjFxzGxCjAfusT6h52xP+qK+/g98xZbXsg6 apEp8+wMW7oGlNYciXuwi8wlTc+Wh29JU5HtQztPF2fOoa/lLriKRJOjTzUAtD8dGOEp 2Yr5Ni8YBCVC/QhR8APj2w1k8aordcKYNyXCp+m56cY6Sx8aSRb22Mfrrf4CvYYMkQjN gKd+BqBd89qEVsiR5liaxrJGaSGEKtIe9fOjjgwrTsD9o4P/zEfN+VByhx3wf0X6oIxA yCBns7ERhB7kF5PVOeLVCdkOg3PPyaTthvmsIjpwGmqjrvtizORdZ4UEXaRRXAh0yUOS 9G0w== 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=QD4gvoO62U8g5ke55m5+fi2BWTvN1Nc+EFebE6YyQOw=; b=T9UB/Lrur7tk2aaIwFphQV0ouUgGuCu0jNlkTdclXp38Cx3N8/ecVIp76e9wchdglp fK+nnThpXHKTm5bEdreBvSc+iJG4XLi6s4hkM5fOd0h9BLZvXHP+xHcm0VinnB9mRIFV kM3pbN+V/16gaaX5vsZdRtY+fMjV8qG2h32Qd6litjijoCoJ1kWGpDBl2SthjxxLoT+l ZQfXt5ZB5ZbwGYgB1+b6V/I7SPV5wCbkhMNFv7mQipM7HD50w66uP8vnnvLXaW4GFKDt KT0sRHW2Ii53Zv4RnMSLNjEj2ROeUM9uhj7a66DJgrsDn3lezniiqQYRQhLpGWqNtmOh UK+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kBRXr4j4; 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 b6si3813066edt.60.2020.04.22.07.43.31; Wed, 22 Apr 2020 07:43:58 -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=kBRXr4j4; 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 S1726643AbgDVOlA (ORCPT + 99 others); Wed, 22 Apr 2020 10:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbgDVOlA (ORCPT ); Wed, 22 Apr 2020 10:41:00 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5EE8C03C1A9 for ; Wed, 22 Apr 2020 07:40:58 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id p8so1186913pgi.5 for ; Wed, 22 Apr 2020 07:40:58 -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=QD4gvoO62U8g5ke55m5+fi2BWTvN1Nc+EFebE6YyQOw=; b=kBRXr4j4qq3NXWS/pXf/1+3fcHvwMlFDdQUdNXX8Wu7dcmXSWvGvQIGl1GSeXcszn9 TWs5J+JwWja8Evmpng7eCALs5Y8vur5RbDbdVdchoUgUl+MLfPl+POJlopFg6bfp7YwI T/2dJTikefM8Is4MK8e4SbGDLkDqdDMEp+Y0xDXJjL3f5/jV2m5uzvEwGs0g5feG3TPp 718JbvYPONmKPMcWHAhJtbZ4L5j7qLNnoLdJCu2yrR8SEb7b3wZqIDFRSojAydH0D4b/ KPeCh+QvkEvXxu5Cj+p5EBZhEZKtuvbQGNYw6SISkzcBo7M86NBCM2/gLAVY+uwQqmDI lT7Q== 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=QD4gvoO62U8g5ke55m5+fi2BWTvN1Nc+EFebE6YyQOw=; b=aGkYhemG665mAm7kET/tQcY49N9XyPU0KIY56GX5M5Y4tJUcPMTmUkaqoHf19MEajp FuA+5cqNGKqiA9jNBJjxpBO4mLm7r0Uy7k7TKZErZ4xz4nmSFOnTOuqmVNcrrHxgsVdK TKxWJAlVKymDgQcPjgj38/VgKMMDZM6fM9fiXj/ihuHfm2HfKJ50c5FKXoF1cVnpdGOa BrBMWYEyHtf0NvrkdD7R2QRygE+uzjGvUocj6MpPTiCzu6UUIyR0mbewq8j1nQ7bUxgi E1lybu2BsthleeIAc+LrnCTJXBX091U3rcWO3zAoXSZdhfwdv9hktSdzlNfFoBZ6a8XX ENlw== X-Gm-Message-State: AGi0PuYmU2GL8JUOtb0Q56niqB6VunyYj3DE4bhv5J82b1g98ihIWMCP auH0J7NTcPG0gfQNAGd5BVrX8is0a15cQiCT27c= X-Received: by 2002:a63:5511:: with SMTP id j17mr25966905pgb.4.1587566458280; Wed, 22 Apr 2020 07:40:58 -0700 (PDT) MIME-Version: 1.0 References: <20200421164543.16605-1-zhengdejin5@gmail.com> <20200422135215.GA25950@nuc8i5> In-Reply-To: <20200422135215.GA25950@nuc8i5> From: Andy Shevchenko Date: Wed, 22 Apr 2020 17:40:51 +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 Wed, Apr 22, 2020 at 4:52 PM Dejin Zheng wrote: > > On Tue, Apr 21, 2020 at 08:24:24PM +0300, Andy Shevchenko wrote: > > 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. > > > Andy, thanks for your encouragement, I think we might be able to fix this > issue first, after that, drop tons of legacy code by pcim_*() functions. > Do you think it is ok? It's really up to maintainer. I'm not the one here. > > > 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 -- With Best Regards, Andy Shevchenko