Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2675299lqo; Mon, 20 May 2024 12:54:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU0f1hhn1SodxLBe3WbdvDQfRZ1RfI3bP0n7Q0w3EvcuU1Q+fsLYQBAKVbxgn5cUCaR8zlWGK0K8XxiliqR8rEDfE04LXPWnWN5tSYU9A== X-Google-Smtp-Source: AGHT+IEF1oVBigXyNlB1jlYUS3fiHOhFF4xm80fP1s8hfHPgu5Go5BM0/dDUNW1OJS7VxhdrjfqB X-Received: by 2002:a05:6870:a710:b0:234:56db:7c8c with SMTP id 586e51a60fabf-24172f6720amr34091731fac.57.1716234849626; Mon, 20 May 2024 12:54:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716234849; cv=pass; d=google.com; s=arc-20160816; b=T64xEo5nsN2vRBoCNaPSy3PcQSx0heqfdjOMHRwhrxBQ1mVyJtzj+oQzYpONWRkdBt QurSnvfe7Ki/q6VqBeFjfmObNJAitJiGXoGiBOGIrKCMXpAlBKRQyBzt4e+Hm7DvXA3E zJB/fgSQp3yZvkbuw2/gF4dF6QfgcJXHFpRoetwr3KasJ1DtiGzC2hSkPHBB1etzI53C Ntr7ualXrwNBFVdcWOiYqChD/RPvpqiE/BUUd6+boqAv4YTUttxkCOGGRb9lyfe3cLIg bt8FF/aSttGV7jP0Y3y+FcQAAiYxNYTBI75h69GeD1jEzHduX1kfvb2hmmFYDjDZJ6yv ae/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=RNe0v1hiI+Na3lqfkBzoVhozidzz71A9MmldK4qsP1k=; fh=8JR2VcfjNIGIHu8gT4PC2bdtgW6TNbjHGSvUuTnFgqA=; b=QELA59jgkJrrqUyt43m+bpHPvRl7Fqwgtdn4TlJLXY+mPGoJvRMoyUTL38ViglyqIE bb+9gdQ6dXk/EbdDDdHmDbbA8MiJy1Lyp/Yt+5dncgeQSceb4muU4+eemhpTHCMyJgWz T6SLIOBb2YlPLr7rJy+7VCpLar0olzlh2ggcgZ0JRj/X518/Ryj2vDQV8YE/Ag0FSfYO bPujpC6aOBaIStUkk8GjSKLNKG2HEGgNXmWuLjpfVd+17+noSXIIKFIYt3qnewBj8CXa oGHAZD+E+iTI56ICIuuAJeTYjDBEpOqtjpVpvjVgSMsWqbkgKWR3FH0xnoOjjTjL+NVR /IuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VhUZLS06; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-184133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6589fba703fsi8184730a12.249.2024.05.20.12.54.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 12:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VhUZLS06; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-184133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 44EFBB209AF for ; Mon, 20 May 2024 19:54:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DE631386D1; Mon, 20 May 2024 19:53:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="VhUZLS06" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEDC912E6A; Mon, 20 May 2024 19:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716234837; cv=none; b=kK0/RM7J8BuFrnRtKzqOK8Exa1+XdkyI5Tjw+nWA6HAcmYpzSlIQQ9JkHJ7/meF9sCz0MMQU6Wz7vdOPQSu5XESgOlMQN4JsqYVuHKnmXnb7bS9mqWDVnW/JosIkFb3EnuN9j58DUMvnWzYMn0t6ZQX7MMtzPpOf97ncNCYK974= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716234837; c=relaxed/simple; bh=QxwadSFkxmRXFr0xxxHIn2pF5xPts2dxqh+DBylu7mQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=rbHgP0hKbo1XOQCIrVUoYgKEq02bUpwsaD5aSi4EPVUiTsu9pm+MJ2xDcui8eTyjJIRewOE2hhs6l6bracFgzs9NaexTUP6Wd3rTrhZwkdkW7Rmcxumd23NHMSXpCpvpH56nTc/WS9+ZFepZ1pnQyPBVDGGDRUhVX7ZtF3sZwsQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=VhUZLS06; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1716234833; bh=QxwadSFkxmRXFr0xxxHIn2pF5xPts2dxqh+DBylu7mQ=; h=From:To:Cc:Subject:Date:From; b=VhUZLS06j1YdBnQbzv56wlvUR5HQvP/1AvkKKjbuDbLyWBUR182YzrNpA53jj0242 /XfRVzmz2NPwJEqJ4wd3q1geEWlr3zMB3hKvXqSCwwLwldwYxWeCJt72l0fQ3kneEc vlqrJdesHy/9tfTO5izTPOAmQKFQymdSt2ocrpWD2o1Al0Tds8TQgKcOziaLorI9au CZ5KW2RBAZAHfCsmQjPa2KhipqUUce1J40a4H6aU1WN+tiM6K7JL5qB7Ly8DW+u324 disEcT1fkvvegQKdSYQvjt9vIAhmHagZsTdVqE5TtD8nBypirSCIvwOI1ug//FF0tI aZUYxFQM7Ln4Q== Received: from localhost.localdomain (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 317083780BFE; Mon, 20 May 2024 19:53:52 +0000 (UTC) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan , Muhammad Usama Anjum Cc: kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: mm: check return values Date: Mon, 20 May 2024 11:52:48 -0700 Message-Id: <20240520185248.1801945-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Check return value and return error/skip the tests. Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index 2d785aca72a5c..bcc73b4e805c6 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -1567,8 +1567,10 @@ int main(int argc, char *argv[]) /* 7. File Hugetlb testing */ mem_size = 2*1024*1024; fd = memfd_create("uffd-test", MFD_HUGETLB | MFD_NOEXEC_SEAL); + if (fd < 0) + ksft_exit_fail_msg("uffd-test creation failed %d %s\n", errno, strerror(errno)); mem = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); - if (mem) { + if (mem != MAP_FAILED) { wp_init(mem, mem_size); wp_addr_range(mem, mem_size); -- 2.39.2