Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp607248ybh; Sat, 7 Mar 2020 06:04:26 -0800 (PST) X-Google-Smtp-Source: ADFU+vtqG6q5ayttGcDh69DvKKGtSwVl+LR6z+MUqROa/FSV0KX4W1ONeKD0lLDakXaf+mm/mc6r X-Received: by 2002:a05:6808:b13:: with SMTP id s19mr431855oij.60.1583589866227; Sat, 07 Mar 2020 06:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583589866; cv=none; d=google.com; s=arc-20160816; b=h4TmS7gOGyU3QIfHX5C0RBpbju0oi1KEgKANvKI1mweCQmmxL5kKkWatO64MT9rVxY mROEQfwmSUf0DAJcye8jA6hO0uGmWT3Xzs5Pfq+zDx3qn+MkqhZPKnEOSl4gOn854Uco fA4bfHn96qQH7XXOXR2dtTFoIOXuhrahOP5lTr3LnW0g2TOP5UZ837k6nkUgbsamMrWq JJBucEGSZb+M+1KDYsoF1gI91DHszmbh4BAJzMmUY2stzIUbZCZ0u/uYvi8d1Dw74EEa 7u5TfwIswsfQ/ZCVYsdF4zQpjVgNiZcqj+BWUbymnettP9Ak9wZLxp6sBnQGiKABVcJU KX6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=gaIKPIrwCubYADjJu7sbLJYt1zqBedkAptVOYUeebnQ=; b=iRyvxJsRD9g2hHNiiUtkVbEciu5OQnv7MhmCAH5DIDDeEOXppNPWsDQJdoRzdE10yT kkoLBrsOnBuqbrHxh/UDuxucAONqcfSem9O52guqmuxQ4MLL3EKDlXbmOUIYIhWR03eI vkCnsiIHglsMyFDlnST1G9egWJuJX3WjdBUFA8KopReDFC1CkvhvARbsoeHDkM/b56lY yV4nLTYhRi/t4VO/RRAl9OPzhpPnI33e73pmq1EWHbNLc0sB6Bj9btOBaQymkFejIsge ehWF2UVvcusi1Qagjex0UifnDnByiXiJ3LlBtzJnnQ9q4X6OwSmlZ+gvFN4I+gtiR1Uk GYqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eJVYKpjG; 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=pass (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 u207si1366503oia.176.2020.03.07.06.04.14; Sat, 07 Mar 2020 06:04:26 -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=@gmail.com header.s=20161025 header.b=eJVYKpjG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726199AbgCGODF (ORCPT + 99 others); Sat, 7 Mar 2020 09:03:05 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40812 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbgCGODF (ORCPT ); Sat, 7 Mar 2020 09:03:05 -0500 Received: by mail-pf1-f195.google.com with SMTP id l184so2569676pfl.7; Sat, 07 Mar 2020 06:03:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=gaIKPIrwCubYADjJu7sbLJYt1zqBedkAptVOYUeebnQ=; b=eJVYKpjGNQy3/0jAQG9Yvmmju4EmftP6llatDBOOPcGbKy29auxZvmVwQ+G9vl+BQh 93rUD5+1vFq6visDWWmiC7Hx4uhVCIQY2Qu4KQLy2aL5Efusmn+k09u0fN/XZp7KSyDK d8cZ78hOaQ8blzha43rIxWxmspnIv9+GBLWwSn/xN2kqMKKjr8oS1nwHqiCa2GnGeUyS 2YNtFB7VqTWNYKuDcGzNGuNFhn/ckhJwOYVkmrvFJMUB0z5mFFrptxFj8P+s7aoIzdlM K/Hscvl/bkXTyhS1LJ2gpKGziIJvN1dE9RW/vLY9cuqPdO1OfpKVv3t6HLGyfejvvZ0T 9A5Q== 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; bh=gaIKPIrwCubYADjJu7sbLJYt1zqBedkAptVOYUeebnQ=; b=pX5PfM9FF4PkxhuiukJWZLfMUvpcctu3Blsy497DeL1nn7Ss+wpOguAyAmBvp4OQqn F3OOJqQ6FCdedriUEpjSXSTF4wNQ4Vnbi8MGlAwfLceLi4+xbk6jrqF1iz+cUBKpcXNg LwqueUj3xXjAXkTQwGNyv/xmCeJQLsIRW2b0U5TND+DwBu/OgtX4xsq/5iy0REVDMNPl NnUHS2Jf4vhepCcULni5ccA6ZlTbN3Bdk5iy4TLi0wNtVmmDNLRttv7peGtdHWkfc8tN 6lav2qufAVX6/EH0X5T+AhP9lvUC3LtdTDCgL5HwMZw0ykWIKVSyCL2DYn69vqW8/S8A wbAg== X-Gm-Message-State: ANhLgQ2UCfOeC2FAQY2CDmN4/902eVSIn9qcxRC/iGlYZv9P6kRJvkX7 aEegRM5qEP4KVYgXf0Uxdrc= X-Received: by 2002:a63:7e52:: with SMTP id o18mr8260708pgn.46.1583589782835; Sat, 07 Mar 2020 06:03:02 -0800 (PST) Received: from localhost ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id 7sm12607320pjm.35.2020.03.07.06.03.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Mar 2020 06:03:02 -0800 (PST) From: Leon He To: shuah@kernel.org, sumit.semwal@linaro.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Leon He Subject: [v2] dma-buf: heaps: bugfix for selftest failure Date: Sat, 7 Mar 2020 22:02:45 +0800 Message-Id: <1583589765-19344-1-git-send-email-hexiaolong2008@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon He There are two errors in the dmabuf-heap selftest: 1. The 'char name[5]' was not initialized to zero, which will cause strcmp(name, "vgem") failed in check_vgem(). 2. The return value of test_alloc_errors() should be reversed, other- wise the while loop in main() will be broken. Signed-off-by: Leon He --- tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c index cd5e1f6..836b185 100644 --- a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c +++ b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c @@ -22,7 +22,7 @@ static int check_vgem(int fd) { drm_version_t version = { 0 }; - char name[5]; + char name[5] = { 0 }; int ret; version.name_len = 4; @@ -357,7 +357,7 @@ static int test_alloc_errors(char *heap_name) if (heap_fd >= 0) close(heap_fd); - return ret; + return !ret; } int main(void) -- 2.7.4