Message ID | 1423044952-5861-2-git-send-email-human.hwang@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <dri-devel-bounces@lists.freedesktop.org> X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AA628BF440 for <patchwork-dri-devel@patchwork.kernel.org>; Wed, 4 Feb 2015 10:16:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7F952024F for <patchwork-dri-devel@patchwork.kernel.org>; Wed, 4 Feb 2015 10:16:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3AE792026F for <patchwork-dri-devel@patchwork.kernel.org>; Wed, 4 Feb 2015 10:16:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AAA606E181; Wed, 4 Feb 2015 02:15:58 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id B6A0A6E668 for <dri-devel@lists.freedesktop.org>; Wed, 4 Feb 2015 02:15:57 -0800 (PST) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NJ800847SIKF520@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 04 Feb 2015 19:15:56 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.114]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 8A.21.17016.C51F1D45; Wed, 04 Feb 2015 19:15:56 +0900 (KST) X-AuditID: cbfee68d-f79296d000004278-b6-54d1f15c32c6 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 0F.98.09430.C51F1D45; Wed, 04 Feb 2015 19:15:56 +0900 (KST) Received: from localhost.localdomain ([10.252.82.145]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NJ8001XMSIGTD30@mmp2.samsung.com>; Wed, 04 Feb 2015 19:15:55 +0900 (KST) From: Hyungwon Hwang <human.hwang@samsung.com> To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] modetest: add null check before destory the buffer object Date: Wed, 04 Feb 2015 19:15:52 +0900 Message-id: <1423044952-5861-2-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1423044952-5861-1-git-send-email-human.hwang@samsung.com> References: <1423044952-5861-1-git-send-email-human.hwang@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKLMWRmVeSWpSXmKPExsWyRsSkSDfm48UQg01fxCyufH3PZrF0Rh+r xaT7E1gspjTnWhz/dJDFgdVj1ZwNrB73u48zefRtWcUYwBzFZZOSmpNZllqkb5fAlXHu8E22 gknCFfs6ghoYlwp0MXJySAiYSNzs+84IYYtJXLi3nq2LkYtDSGApo8SDjU+BHA6wojULDSDi 0xklVh1cwQThtDFJLHpwhh2km01AT2LBtR9gtoiAssTfiavApjILVEpcfLeRFcQWFvCTWHn2 LVicRUBV4uK6h2A2r4CbxPdJv1ghrpCTOHlsMpjNKeAusezkdEaQI4SAarZ3OILslRD4ziax 4NMVqDkCEt8mH2KBOFRWYtMBZogxkhIHV9xgmcAovICRYRWjaGpBckFxUnqRoV5xYm5xaV66 XnJ+7iZGYOie/vesdwfj7QPWhxgFOBiVeHgF8i+GCLEmlhVX5h5iNAXaMJFZSjQ5HxgheSXx hsZmRhamJqbGRuaWZkrivIpSP4OFBN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: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: sangbae90.lee@samsung.com, Hyungwon Hwang <human.hwang@samsung.com>, robclark@freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <http://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <http://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 6ce8717..5fcf2a4 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -1636,7 +1636,8 @@ int main(int argc, char **argv) if (test_cursor) clear_cursors(&dev); - bo_destroy(dev.mode.bo); + if (dev.mode.bo) + bo_destroy(dev.mode.bo); } free_resources(dev.resources);
When setting a plane is turned on without setting a mode, modetest terminates with segmentation fault like below. So this patch adds null check for the variable storing the buffer object in set_mode() which is null in this case. [ 4759.016695] modetest[619]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006 [ 4759.016959] pgd = ffffffc0b25e1000 [ 4759.017062] [00000000] *pgd=00000000d3492003, *pud=00000000d3492003, *pmd=0000000000000000 [ 4759.017312] [ 4759.017365] CPU: 0 PID: 619 Comm: modetest Not tainted 3.19.0-rc7-00347-g458583e-dirty #56 [ 4759.024713] Hardware name: XXXXXXX board (DT) [ 4759.029629] task: ffffffc0b24d5e80 ti: ffffffc0b2a3c000 task.ti: ffffffc0b2a3c000 [ 4759.037071] PC is at 0x404610 [ 4759.039992] LR is at 0x4027f4 [ 4759.042962] pc : [<0000000000404610>] lr : [<00000000004027f4>] pstate: 60000000 [ 4759.050356] sp : 0000007fe65a6f90 [ 4759.053620] x29: 0000007fe65a6f90 x28: 0000000000421060 [ 4759.058912] x27: 000000000041f000 x26: 00000000004226d0 [ 4759.064207] x25: 0000000000421200 x24: 0000000000000006 [ 4759.069502] x23: 000000000040e790 x22: 000000000041f6f0 [ 4759.074797] x21: 0000000000421060 x20: 00000000004216a0 [ 4759.080091] x19: 0000000000000000 x18: 0000000000000000 [ 4759.085386] x17: 000000000041f2c8 x16: 0000000000000000 [ 4495.006841] x15: 0000000000005798 x14: 0000007f93691968 [ 4495.006850] x13: 0000000000005500 x12: 0000000000000005 [ 4495.006855] x11: 16170f12001a1311 x10: 00010004157f1c03 [ 4495.006860] x9 : 000000000000083b x8 : 000000000000003f [ 4495.006865] x7 : 00000000000018b2 x6 : 00000000004226d0 [ 4495.006870] x5 : 0000000000000000 x4 : 000000000000000a [ 4495.006875] x3 : 0000000000000000 x2 : 0000000000000001 [ 4495.006880] x1 : 00000000000064b4 x0 : 0000000000000000 [ 4495.006881] Segmentation fault (core dumped) ./modetest -P 13:200x200+0+0 Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> --- tests/modetest/modetest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)