Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753557AbbHCOCe (ORCPT ); Mon, 3 Aug 2015 10:02:34 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:53525 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753300AbbHCOCb (ORCPT ); Mon, 3 Aug 2015 10:02:31 -0400 From: Nicolas Schichan To: Daniel Borkmann , Alexei Starovoitov , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nicolas Schichan Subject: [PATCH 1/6] test_bpf: avoid oopsing the kernel when generate_test_data() fails. Date: Mon, 3 Aug 2015 16:02:03 +0200 Message-Id: <1438610528-14245-2-git-send-email-nschichan@freebox.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438610528-14245-1-git-send-email-nschichan@freebox.fr> References: <1438610528-14245-1-git-send-email-nschichan@freebox.fr> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 885 Lines: 30 Signed-off-by: Nicolas Schichan Acked-by: Alexei Starovoitov --- lib/test_bpf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/test_bpf.c b/lib/test_bpf.c index 3afddf2..6843d0b 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -4672,6 +4672,11 @@ static int run_one(const struct bpf_prog *fp, struct bpf_test *test) break; data = generate_test_data(test, i); + if (!data && !(test->aux & FLAG_NO_DATA)) { + pr_cont("data generation failed "); + err_cnt++; + break; + } ret = __run_one(fp, data, runs, &duration); release_test_data(test, data); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/