Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05A4AC4332F for ; Tue, 14 Nov 2023 12:32:39 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 56C413CE021 for ; Tue, 14 Nov 2023 13:32:37 +0100 (CET) Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 520C33CC27C for ; Tue, 14 Nov 2023 13:31:43 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 5D2FD600735 for ; Tue, 14 Nov 2023 13:31:42 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D4FE01F899; Tue, 14 Nov 2023 12:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1699965101; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cvv52B2c3wWU3YrNUy1yIwaOGrQScvhpupdOwX19Bpo=; b=qPoVIL+HC7tmPMdkROzP2zWncRPZ5L6wrgoKFG/c9il4HU+667RSQ2ZQkp77FDcHSNgwOO s2i3W1rSFnjPk3FUDYEst4XiHNLSMeVUY3m7AW36iNZIr20IPGIb0Z0IoEL4pyJiKqQ9N4 krawhTu6Tzre7eRV/yzz8f7w5ISHVL8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1699965101; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cvv52B2c3wWU3YrNUy1yIwaOGrQScvhpupdOwX19Bpo=; b=j87jmansSftIov+r65luz+31BqPE4V47fNhhyXMTZHHcv2nqWQIpIkBV7B9CelvuFr1S7V cE7F2Tn3bbZJwzAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AFAF813416; Tue, 14 Nov 2023 12:31:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SL0bKq1oU2UibAAAMHmgww (envelope-from ); Tue, 14 Nov 2023 12:31:41 +0000 From: Martin Doucha To: Petr Vorel , ltp@lists.linux.it Date: Tue, 14 Nov 2023 13:31:23 +0100 Message-ID: <20231114123140.1144-3-mdoucha@suse.cz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114123140.1144-1-mdoucha@suse.cz> References: <20231114123140.1144-1-mdoucha@suse.cz> MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [0.89 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.01)[46.88%] X-Virus-Scanned: clamav-milter 1.0.1 at in-5.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v2 2/5] tst_netlink_destroy_context(): Allow safely passing NULL context X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" Signed-off-by: Martin Doucha Reviewed-by: Petr Vorel --- Changes since v1: None lib/tst_rtnetlink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tst_rtnetlink.c b/lib/tst_rtnetlink.c index eacfdced1..bf782ffb5 100644 --- a/lib/tst_rtnetlink.c +++ b/lib/tst_rtnetlink.c @@ -55,6 +55,9 @@ static int netlink_grow_buffer(const char *file, const int lineno, void tst_netlink_destroy_context(const char *file, const int lineno, struct tst_netlink_context *ctx) { + if (!ctx) + return; + safe_close(file, lineno, NULL, ctx->socket); free(ctx->buffer); free(ctx); -- 2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp