Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2499149imm; Mon, 24 Sep 2018 05:30:59 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb/xnZ+rI05pYoEyS3jM4QwX8N4/lUon8X/oEoZVMG1uRe1VQNd3ALVzLDCtK64C1zcNQK4 X-Received: by 2002:a62:c406:: with SMTP id y6-v6mr10231870pff.161.1537792259271; Mon, 24 Sep 2018 05:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792259; cv=none; d=google.com; s=arc-20160816; b=DFVKA6nZSVsMaSJ/I8HDAlnckVcEy9oKiUD4ZfdcPqFu2mgBModYYEA894sIEkQb6P 2qAVoISgiDChaywYL/1czIxLMZCVw/RA57kgOUkUBvm/+3oY7jIxbG6n8WO3os2OdVBR PAH5QlDm58OSVPfG0hduSdOg3sTu/W6KBypZB1s9HzmnVfszHf3S8RS6zPHvSorRc/wT VqtguZgyiZQURA7jHXQhmBqhbPZS4CMYnJ6I83rQin9oEAbct5FZS49Pj5pNUtQHVqiG 4JDQUpCPTcU8vr71n0xWLl2HUvF/RAvZyAq/SI2XveWMNTNB7lSxJJbg0v4ZDXnYBvS7 kzKQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=+0ZBpf+S2nrQCnEQZJpGUdIutgS3j894E/fLIC5n/rA=; b=F+vGfhY+yLaoDpNZInpyVD+iv4+qAuFIpyjvgC91oM+X6VQEyYFcQF1WUdEkb3Rt8D JZsMTH4B33nAo2XJAbupndiloxnZl1XAysMGi1jIMLQ9d9YGTqkBck/niSOuJWHNAQeQ RNXvvq5kn7xP89gKEvfYCeNP1smwxmkyEWvNA3k0Isc5IAHtQto5pFx0cMNmIEYVbvsf kjbSSS0yqNQAMfT/jAx3ngEZ4xxD/nzg9yGlbEs7yCVVlCljRZuGxMbPv4YFEOGRwiLO ndsJKoNdd8vyFhZdFcjb/+xogVuOGAXhBMrO4U9Ec/qb7znWYigjVfOWq0RviBZdZMSp VFXw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p184-v6si13525443pga.536.2018.09.24.05.30.43; Mon, 24 Sep 2018 05:30:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387767AbeIXSbh (ORCPT + 99 others); Mon, 24 Sep 2018 14:31:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57670 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733082AbeIXSbg (ORCPT ); Mon, 24 Sep 2018 14:31:36 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F3EEA1098; Mon, 24 Sep 2018 12:29:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anton Vasilyev , Aleksandar Markovic , Miodrag Dinic , Goran Ferenc , Bartlomiej Zolnierkiewicz , Sasha Levin Subject: [PATCH 4.18 053/235] video: goldfishfb: fix memory leak on driver remove Date: Mon, 24 Sep 2018 13:50:39 +0200 Message-Id: <20180924113110.435235634@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anton Vasilyev [ Upstream commit 5958fde72d04e7b8c6de3669d1f794a90997e3eb ] goldfish_fb_probe() allocates memory for fb, but goldfish_fb_remove() does not have deallocation of fb, which leads to memory leak on probe/remove. The patch adds deallocation into goldfish_fb_remove(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Cc: Aleksandar Markovic Cc: Miodrag Dinic Cc: Goran Ferenc Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/goldfishfb.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/video/fbdev/goldfishfb.c +++ b/drivers/video/fbdev/goldfishfb.c @@ -301,6 +301,7 @@ static int goldfish_fb_remove(struct pla dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base, fb->fb.fix.smem_start); iounmap(fb->reg_base); + kfree(fb); return 0; }