Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp831408pxu; Mon, 23 Nov 2020 05:25:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEeGpJi+qrSz8F6sJC+0nN8EucvYZTGqTAoEhYvSfk/U2jc87U2Lfl2GX+k4oIJDWj0Y2m X-Received: by 2002:a17:906:8c6:: with SMTP id o6mr41461088eje.230.1606137918675; Mon, 23 Nov 2020 05:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606137918; cv=none; d=google.com; s=arc-20160816; b=gF/MtOhZpGZbgFbgJnTLePUJryVgEH2NjGZ+Huf8+S+l6mqT63PsZepKlPDEXK21Lq oKpUiA0JY1DoEMM7zH+hrGhB/ao7XDVSoRBBi9ruTwXGt1VliSnhTsLqyvnsKk+k81ew 0nH1fMbSvZB8zOlGdz09KA6XJu3L16Lp22uwWWKrvbBdFZndH/497iVKq0LvreUl/8CT cwMtIJu3wbO6nwE5WOT39axGSwMoMqxKEI1NC6a65XHbw7Mx8J8B/SLvoJFYLhKZ4axu ZgxMGf43kwEDYJYLYYljdv6G4h2NFRAjyk0gBCdld4DYcAnWyf1K9b9cxPova2g7Xwdf ZIvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ojMm357C6NFIM69ZRtRja+lDbuIGeJp1Rd5zwuj4Wtc=; b=bUfxykaYmVs1B4Gj+w3NG8vycKXNekCkIwCiHqKfu/ojt1hyHGfORrMCDjya1RG7Vo yL73TBz+k+14TzRWIVfYMJh5NPVyb95cTjqjYvu+/bcV8n7/yDZYNkd95a4+KVz5Day1 P8/K/P9ZJjfTwtwZjCYl3kJdG/Em3TsuLt1ppE1uKo8Ug3YkMK2gioNYB8BHxOW997F/ DJC4ZgngFYJ6d0SkiqVZ+FmwiaT2fM/5wzMII/NhLH/PbMODfJ7O8NYJt0b0ob7vxtYo TtuH2ty/T1Ui3oiRVNrEAeYkg3t/CdymMtlWNJbIDd9RveShRn989ROLUQHdnNRS3DQL 6jpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AVO92ocu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si6456421ejk.142.2020.11.23.05.24.55; Mon, 23 Nov 2020 05:25:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AVO92ocu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732168AbgKWMjD (ORCPT + 99 others); Mon, 23 Nov 2020 07:39:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:50974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732092AbgKWMi0 (ORCPT ); Mon, 23 Nov 2020 07:38:26 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 704E72076E; Mon, 23 Nov 2020 12:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135106; bh=ZvAH1k7Ouwyd3QMqedfB2CKV4/JJlmCX0kVnLt7Ih4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AVO92ocuKYoJnESscS47n9IVSGfbhlILIEuF8prt9ryT1P690jhDSGsnLTvykDHn/ 9gUnd/zIm6DXvxt9d71W9faktHYGbYo7fTMHkAXTh4toBGPCEOSWIqRKZGb3Nvw7gg Ijhg/TcIQb5mnK7Yf+5Cn4m9tasq6pgSejJyCUp4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Hai , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.4 089/158] selftests/bpf: Fix error return code in run_getsockopt_test() Date: Mon, 23 Nov 2020 13:21:57 +0100 Message-Id: <20201123121824.226463079@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Hai [ Upstream commit 2acc3c1bc8e98bc66b1badec42e9ea205b4fcdaa ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 65b4414a05eb ("selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTI") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20201116101633.64627-1-wanghai38@huawei.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/prog_tests/sockopt_multi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/sockopt_multi.c b/tools/testing/selftests/bpf/prog_tests/sockopt_multi.c index 29188d6f5c8de..51fac975b3163 100644 --- a/tools/testing/selftests/bpf/prog_tests/sockopt_multi.c +++ b/tools/testing/selftests/bpf/prog_tests/sockopt_multi.c @@ -138,7 +138,8 @@ static int run_getsockopt_test(struct bpf_object *obj, int cg_parent, */ buf = 0x40; - if (setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1) < 0) { + err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); + if (err < 0) { log_err("Failed to call setsockopt(IP_TOS)"); goto detach; } -- 2.27.0