Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp199212ybh; Mon, 9 Mar 2020 19:36:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv3HAh/cPwFibuRPNJNeJ0aN/pZSYvlGq/Qm8u9m2P+DELpDzsyEZ+AQeALqg/9AxZXwtsc X-Received: by 2002:aca:4509:: with SMTP id s9mr20055oia.24.1583807797299; Mon, 09 Mar 2020 19:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583807797; cv=none; d=google.com; s=arc-20160816; b=ROhW87CipDIbdnkL6LbduNV+ZU+uTDKqvCECkokCOXT8WLFhffkBnnhdc28Hnu6VAX 08NHhKloNN78oRSTjU8FhBhP6Est4u65LM/9emeUDIE1A7UL3I7DMo7/FN3szDjtfYKY O3UfzDpFoxGk826tFqQyXtG+w2+imtf5QhNtlummNLSETXYaksWeOxw/zEDitEVuua5q 20aO2cjNS0yZxs4evvXl75fFtharnW4yQD4kJ5+JVl5o+ddbVpoAFcIz60xt0oUP8ODM Aze5Eok3VntI6bUCP6iuQ1OlLxlgZR1L7wpmExMgsZ+fei0q9vfQc4mF03mT6ozET2lK DkvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=weiT/gNMaT98DNcrVoArqN1n8qFeWFcO2aQcNrwiOqg=; b=Spl86wDDqNW6I0i5jQBVZu8PsL7gcdBVu+uWPaDk3H2AOruaz9Ogk0JKthJIZ5YLxA 5GPPrETg03uzENXy2kW+sRVqxoGKkAE8NgqryeDQQQBWnPRURu/YbUsEzhZekhXiFru/ sO2A6VxeqK99om8WBdVtjGp478eoIYDJQEd3fGZ5fsJ5eZdLMrdLsM0EORL/hOZZRPPQ Aza+eHqeLjJQFgkyTw68tvS0KtyyeDAG9Oth4+4Rnvp4oNhdm3hHhPv02hGK8arF77po RMjraTjFYRuSW6HybmjGh7FFJ6O8E+6hxWKCGCRTPcaGsZUtA64FZdIYGlnZxGDBUTMj LFbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=uxXytDB3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w29si2083585oth.24.2020.03.09.19.36.21; Mon, 09 Mar 2020 19:36:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=uxXytDB3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbgCJCfr (ORCPT + 99 others); Mon, 9 Mar 2020 22:35:47 -0400 Received: from mail-pj1-f66.google.com ([209.85.216.66]:40351 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbgCJCfq (ORCPT ); Mon, 9 Mar 2020 22:35:46 -0400 Received: by mail-pj1-f66.google.com with SMTP id gv19so771917pjb.5; Mon, 09 Mar 2020 19:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=weiT/gNMaT98DNcrVoArqN1n8qFeWFcO2aQcNrwiOqg=; b=uxXytDB3DRQOxrf6pVlKVlOQH0reGS/RA0mfsP2HFwvi0wllV2YKlIc6k7vHehz7/6 1gSRXObd3WUwmpYBMiflWSSOTPFZOZZCUH+FjuKa+U+MOv7noMKdyhzJ7cgnqveEIaPG ZwZEEjoQnFIR57tphVcc4UE9MLyQXd9qUVxMAFIvEDNZxhoe4atpBb6WTV2MF83yvv6P q2kGNu3xBAMQUZZ6Uvn0abfyYWgqJcYOM9L1O8G5J2ntuY/u6b/TP7Ldg9mX8kOBPGla Z6lKmLItIFm1rieh7LRe7UUUtOkuw78CLJ0he6t8cSeTDIlxFR91rsQSt/iBxwOagnY+ qPoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=weiT/gNMaT98DNcrVoArqN1n8qFeWFcO2aQcNrwiOqg=; b=N8TjHBpJouKWMTnDIxAi38aoWzWwxraZuDuckX4wadhOHGHXx0/JeVGpz5xdrqjrvS p4Ffl08wYt19p3jnmiAeoFdKvlXxuYDJOXypsYbUWE8q+G+HAJaQzGlCbCBRC2iq37Wu JI/X36aIUSXF8M7w9JFV8ONN2UEtvLpVWIJ48/N/rfOPUAQWSqg44ji5oWy3wG54HTdy hKkQ/IBWpogh2PpUj6w+d2TKkDFnQIG/GGZrqoPZOYVlsTnNFfMkoaNk0NmDwvA30+SC oYY9nhqcyhkf9UJo80EgYC+Oi9W4/I5Fk9aSDyyoHhRzYhGzbFRXApDVLj2F17+I6crE 36Kw== X-Gm-Message-State: ANhLgQ3ofyctJ/qgxSlCCC0vdlpo9wtTj8YnqvxtPymUALgyhQhFT8/2 pmmcymHxKreK2Id4Z5mAJkM= X-Received: by 2002:a17:90a:2ec7:: with SMTP id h7mr2487827pjs.107.1583807745548; Mon, 09 Mar 2020 19:35:45 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.gmail.com with ESMTPSA id u11sm816627pjn.2.2020.03.09.19.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 19:35:44 -0700 (PDT) From: Chuhong Yuan Cc: Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH v3] video: fbdev: vesafb: add missed release_region Date: Tue, 10 Mar 2020 10:35:36 +0800 Message-Id: <20200310023536.13622-1-hslester96@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver forgets to free the I/O region in remove and probe failure. Add the missed calls to fix it. Signed-off-by: Chuhong Yuan --- Changes in v3: - Revise the commit message. - Add an error handler to suit the "goto error" before request_region(). - Revise the order of operations in remove. drivers/video/fbdev/vesafb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c index a1fe24ea869b..c7bc9ace47d4 100644 --- a/drivers/video/fbdev/vesafb.c +++ b/drivers/video/fbdev/vesafb.c @@ -439,7 +439,7 @@ static int vesafb_probe(struct platform_device *dev) "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n", vesafb_fix.smem_len, vesafb_fix.smem_start); err = -EIO; - goto err; + goto err_release_region; } printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, " @@ -458,15 +458,17 @@ static int vesafb_probe(struct platform_device *dev) if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { err = -ENOMEM; - goto err; + goto err_release_region; } if (register_framebuffer(info)<0) { err = -EINVAL; fb_dealloc_cmap(&info->cmap); - goto err; + goto err_release_region; } fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; +err_release_region: + release_region(0x3c0, 32); err: arch_phys_wc_del(par->wc_cookie); if (info->screen_base) @@ -481,6 +483,7 @@ static int vesafb_remove(struct platform_device *pdev) struct fb_info *info = platform_get_drvdata(pdev); unregister_framebuffer(info); + release_region(0x3c0, 32); framebuffer_release(info); return 0; -- 2.25.1