Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp648216imu; Fri, 11 Jan 2019 06:46:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4H3LFzlsGszORIPOWYqUruz0XdxHnzNG3eHoZ2m9d/hRXXNdFBWW5cZxjTrAQXMVIuGRlm X-Received: by 2002:a17:902:20c8:: with SMTP id v8mr15078899plg.319.1547218000470; Fri, 11 Jan 2019 06:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547218000; cv=none; d=google.com; s=arc-20160816; b=U9G5kubae2Y1c70qpv/o/Bt/B2pF0X6IxHIZfNYReDK99bgVQjHE2mswZr4B+DZX3m VnCxoApThArFW0XHrBaMYCREY0mqLC/D66T7c+xz9IK0zXTAm/6Msbrpgaq8B5GDcjXR aOEOuzAODENOuc3uVu7F/ULPCUJlGw3CppQZzQqqtj9klIsbucyTjp4cUptT0YQZX8Tu wrn5pirkpsdHehBfCu6MbAOeaoWL8g0IUKWDfQM1TrhDHp88Iv1ad3wPf62uQ4JEqwWW 3/mfB5fT5WnHlnZjmxwXUM5u1kbSUEdQGv/fnHtoK27lsRCuQlSgt6FR+484KLCr1Hs4 kzdQ== 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:dkim-signature; bh=2C7vkeL8nztxKVIqqq1EVZTWu2ZJwj0ZUZjDc92ChZg=; b=qkGXv1ln2gfj56n+HWan2KUwrpAyIv9Yo+9nk8lUvTN9xPkQ6oXcKUNvO4JUHNSOKB YCRO2LmUW7y0C/th8g4CF5qeBKpMjD4yebRUYqOvtoYg2ungBDVYgxMoHxek7KTlJCfm 1NB6agEvsw7KQ1NXS8smjpf2UCH2FwzSgx1PGWR6NqGgGnNPF+6lHyAfFPafHv2F+cK0 6XqyYXQrKHvPQiT7mmCDVSz/qmX+tWtH8cYIrsIRAaNeQ2OwLE33sIyULS+Vjj2kdydc +WuMMMjliEcIdxz8WJEBQSTstme3+AWw311f0Y0VH2T8BUd9LzzLxd9OfEM0ISDLhd0K htNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Zg/RPw10"; 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 w8si14826958pgm.467.2019.01.11.06.46.25; Fri, 11 Jan 2019 06:46:40 -0800 (PST) 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=pass header.i=@kernel.org header.s=default header.b="Zg/RPw10"; 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 S2404441AbfAKOnm (ORCPT + 99 others); Fri, 11 Jan 2019 09:43:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:36592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731160AbfAKOnl (ORCPT ); Fri, 11 Jan 2019 09:43:41 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC0CD21848; Fri, 11 Jan 2019 14:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547217820; bh=680FHC8+R+J36t1bmkZ8SeAabefGiJAHY4hbHt0B0qU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zg/RPw10y0fbe4Zm+4M0xMG4j8tGqr0mjofgEB76JlJO4upk4gR03bniGAGiDWwnz WcNqaanCM7Zt5VYTRWcC6VuZQmWm1sp7FYH563ux0jbAugrahfurn+xzuQ54B0jFwe 7bRrvKs4CxOisaspJ4EKDX4jUvrVkLHFupMr6yPA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YueHaibing , Daniel Mack , Robert Jarzmik , Bartlomiej Zolnierkiewicz , stable@kernel.org Subject: [PATCH 4.20 53/65] video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data" Date: Fri, 11 Jan 2019 15:15:39 +0100 Message-Id: <20190111131103.409320015@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131055.331350141@linuxfoundation.org> References: <20190111131055.331350141@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: YueHaibing commit 2607391882fca37463187e7f2a9c76dec286947e upstream. 'info->modes' got allocated with devm_kcalloc in of_get_pxafb_display. This gives this error message: ./drivers/video/fbdev/pxafb.c:2238:2-7: WARNING: invalid free of devm_ allocated data Fixes: c8f96304ec8b4 ("video: fbdev: pxafb: switch to devm_* API") Cc: stable@kernel.org [v4.19+] Signed-off-by: YueHaibing Reviewed-by: Daniel Mack Cc: Robert Jarzmik Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/pxafb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -2234,10 +2234,8 @@ static struct pxafb_mach_info *of_pxafb_ if (!info) return ERR_PTR(-ENOMEM); ret = of_get_pxafb_mode_info(dev, info); - if (ret) { - kfree(info->modes); + if (ret) return ERR_PTR(ret); - } /* * On purpose, neither lccrX registers nor video memory size can be