Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2143605ybz; Thu, 23 Apr 2020 12:21:39 -0700 (PDT) X-Google-Smtp-Source: APiQypLtBhflAbXJvMHnVoJuSsNu6YBgTXi8JDpuls5eQtvj8RTtOcz4ODx/cqny0OphEdSDK4HQ X-Received: by 2002:a17:906:361a:: with SMTP id q26mr4167055ejb.292.1587669698807; Thu, 23 Apr 2020 12:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587669698; cv=none; d=google.com; s=arc-20160816; b=K7p6mU9z2FjWhps/JQ2b1KEdP5I5uAdGWsD8pAoebBfyNxEoYLudpGLYHCa37o5/Uz 652Vfekk4TvOwVMiGldeSKg4OaVFS4hw1Y0RnoNMAF1g1kNBl5Ih9yVEARCZDH5C57Dv TynEVE3z3xMkWi38nI8ruvTzTtGDlD1yMjHbxHWxNLY0oa/eEV8VcC/ajY93w6pYKg96 HI8x9ikb2PY1SfiJvF8fMqxMjOvlFfiqINBFwtksqcnwTuiRfw1GywpUcJDtI2ia2e3m awjv0rEulbd0zUpqBh783v+GNFBnvJ8CN/uKwgQ6W3jBlxDgf9LZgbXtBobPMYPM1j3C kzNg== 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:in-reply-to:references:mime-version :dkim-signature; bh=/sb3dlUj5FrGwmCMaw1i7cs39EU8HrExHVtJsyVG3VY=; b=xNvZSrpHebDx9qktCOdttiFMGKfI2oY5gwtOB8XxEc0rVaClhIiBB5sxM2M9F00gFc LyQk6Beu2WsQcLXcATL0LSKaffdiRl3V151Pbj3r6jbQReFArYsrKWH/RRdYmhAeYHlP Nn6ZLPjBxof471itstlHYdqHSI8RbRM2VdjNJObInFzEKgxM9jB9Ipap6XLtIaxZ8juk wGDZdelxGzkKRjEaBLyiSEcRmAHO1KticQEyZ8YG3fn6M0BLTZmtqTkV4SrOJacRmIqY /XFw5aCpVHlXJ75uymZBIpwQaMKUDLawrW3/7XmMDFO27ribEd+qAunlCP1dO4lMFtD0 D7zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oyIVHUIM; 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 do22si2223204ejc.1.2020.04.23.12.21.14; Thu, 23 Apr 2020 12:21:38 -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=oyIVHUIM; 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 S1728836AbgDWOwR (ORCPT + 99 others); Thu, 23 Apr 2020 10:52:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726380AbgDWOwQ (ORCPT ); Thu, 23 Apr 2020 10:52:16 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96078C08E934; Thu, 23 Apr 2020 07:52:16 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id w65so3041100pfc.12; Thu, 23 Apr 2020 07:52:16 -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:content-transfer-encoding; bh=/sb3dlUj5FrGwmCMaw1i7cs39EU8HrExHVtJsyVG3VY=; b=oyIVHUIMteQ+Jyujbx3EDLFuw+ISWFk6HIHSvS6fYlUsxnyisljN8Ia6w8b2XrbWI5 kn/ZnFcbY+qdKeF4vLEem6y/yZrATTRtLYUbkbxX3dq1jQP4X9U7bqOquWVm5PQ58wIk zQFJtrba2s5XmQtB/1CUeF+UNtgy0Yi8WYrsAzHDHbkhJbbtS8LHnkI2ZWLBtfq8FGl7 n/e8I9fe0HozYBhAYBxbmkzDW7MPkIPONX9Wc16T4KH3D7OeN4TJyax0hcFB6T5/cnEQ PMi7d1gyQRk9aDLupdLrXQo4rLNH0emHJrkAKy0ai5BJJ6Z8/NjsAqq8kSnh0lLmjYHd d3Bw== 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:content-transfer-encoding; bh=/sb3dlUj5FrGwmCMaw1i7cs39EU8HrExHVtJsyVG3VY=; b=iVPE5J1N4c2m6sNJbechtJqGxq6C0vF8CwJYcm7CBQXNiA934g7f/v96eZ9dv+qaS/ ImPEEQakcLsaI/hE0T8IhmhF0QKO8fDnhJd1pweym07BQbAJwWeULT19RzsjZZslwnj8 LSrMZGJHYS0gOqfK9yQqzlCd9p3Gjk4a5l1938L3gnILiBU7oy9MfjKPNeSRnT87iiaZ 01p/vaMr1RG0G+CTWTK8ZlFRP9lHavCSIPklLCZS7NIjhd80r2FrXroHe7apXf9a9Giy WSEqcJaJOeNkyNzJviG+7anSbHQZja/1iAKO+9ixHeB4GGLmyAABPW5UqGhq2y02D+JJ aVQQ== X-Gm-Message-State: AGi0PuaiJzJGltWNvCC5LUi9/ICVAHx3qN2TpgwYaMN76Oeen3LtsDP0 onnRv6z5JsEjqEHIbfppfwD2nIxdkVQflhf1HlI= X-Received: by 2002:a62:5ec7:: with SMTP id s190mr3964136pfb.130.1587653536121; Thu, 23 Apr 2020 07:52:16 -0700 (PDT) MIME-Version: 1.0 References: <20200423142627.1820-1-zhengdejin5@gmail.com> In-Reply-To: <20200423142627.1820-1-zhengdejin5@gmail.com> From: Andy Shevchenko Date: Thu, 23 Apr 2020 17:52:09 +0300 Message-ID: Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe() To: Dejin Zheng Cc: Greg Kroah-Hartman , Thomas Gleixner , FlorianSchandinat@gmx.de, Bartlomiej Zolnierkiewicz , Ralf Baechle , Thomas Bogendoerfer , dri-devel , linux-fbdev@vger.kernel.org, Linux Kernel Mailing List 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 On Thu, Apr 23, 2020 at 5:26 PM Dejin Zheng wrote: > > A call of the function =C2=A1=C2=B0do_take_over_console=C2=A1=C2=B1 can f= ail here. > The corresponding system resources were not released then. > Thus add a call of the function =C2=A1=C2=B0iounmap=C2=A1=C2=B1 together = with the check > of a failure predicate. ... > CC: Andy Shevchenko Use Cc: Better to read. ... > v1 -> v2: > - modify the commit comments by Markus'suggestion. What suggestion? You need to be clear in changelog what exactly has been done without looking to any previous mail. ... > console_lock(); > err =3D do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1= , 1); > console_unlock(); > + > + if (err) > + iounmap((void *)npregs); > return err; > } I have briefly looked at the code (it is actually quite old one!), and I think this is half-baked solution, besides the fact of missed __iomem annotation and useless explicit casting. The proper one seems to switch to memremap() and do memunmap() here. --=20 With Best Regards, Andy Shevchenko