Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp454595pxb; Thu, 9 Sep 2021 04:59:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7JdwylL5zAE4pZhSIRkFoVbmq/eTBSj3t2I7osUS7EVi6+g1TcXO6+aVY/xAEiO9Os2rA X-Received: by 2002:a6b:2c08:: with SMTP id s8mr2264009ios.216.1631188797641; Thu, 09 Sep 2021 04:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188797; cv=none; d=google.com; s=arc-20160816; b=pXg49S9QryRLtfLyQ9XsNLkY3aeagO1jmfJYJrlzO6Wm4wai62Ug9iWTyNPqwyCOyx owZPzcAuTEhzlmPlLWdVQ44EqPABCHvSClQl+l0IB0jEKKtcJK6pwUAQRsvGDZ2gr3re 6guVeDte3PvDM0L+uuC21+Q1WWia7w58ZGCeE2GgMfN8oMIVDwl2cmFj6SzvmoNHwwZw tiOVeMi5lBuKiaMnabitrGN1vBhPXFYmElE4vrlIiirlB1ux0E2bseCqaGP1g66bT1w4 zFbwC8UC+wZidw0OdaGezCvJM7147RhRsKq6l6hskBchV8cOmMWyG/9KUM8aouwmokZ+ dcVw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gyZLfzyPkgKKjren77A1oF1GcrLIjqs2BoOBMq+rJQM=; b=ee4Ih3RKKmG1mmNSfcU6KKZfMOca4T9IFj9iEVFgv/Ub04FQr+V8cJY/jOpsYfZulJ s+owf6lv8lYBon1Eg94lRtuvX39Mt6UkMoFaSRbWf5soyy/Vt1wgolu4OU8Hd7w8ZFlp QBxLJhWMRQvpqx24RoIfxXSNVQCdYgIahnXd1jPSPVpfyUW4IcZnBfCn2hgMQGvWm0S3 3uBSMJGo9Ugtkn04omFSRwAVFhUs9YIK04lewTTrWlkfqW2A3pM7vVv2GT+KEScVH6q5 3XL4HulZg5WcpM+JgcMrKT2skveKvUS/mWApAMMOZhq7wifRF5LwEa69H9+XWLq4ye+3 yHSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dlzDDyY5; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si1821805ile.180.2021.09.09.04.59.44; Thu, 09 Sep 2021 04:59:57 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=dlzDDyY5; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244883AbhIIL56 (ORCPT + 99 others); Thu, 9 Sep 2021 07:57:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:34482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244419AbhIILyh (ORCPT ); Thu, 9 Sep 2021 07:54:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2F15B61373; Thu, 9 Sep 2021 11:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187894; bh=qEiAm24eqpsL2TxBMKk2BMy+kt0VnPszMUVXtFF6ej0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dlzDDyY5W5A5A5QonZQBrnWtY8lHth2qvYoWgaxDM6aRSRpTn2aye+yslonLob0aJ q+lDKElQX6sZkHDwwoKkkx9j1q40l9u8Q+OCb/FS5L0aXE69a5XRvwBDw6rmXm7U+S Jw/9GsIhMDkIQDmeHjoE8KeW9Jl3Xz2cDBZaaYp8LgDbx5VWqHmowvrEo93x7mTOoW f+ac6fYmY2fB2AiFlcJQyWkZKPdgstf6cRmOBAhXnBrDXsgD8xi/9ql9HDmMzc472P RVq2e2fpqECYtETxiLBSWXWf2JHIUwpIfPd4borgw0MAqaziJyFeQF7N351+HZI4eT TZTV8STUkGFFA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bongsu Jeon , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 175/252] selftests: nci: Fix the wrong condition Date: Thu, 9 Sep 2021 07:39:49 -0400 Message-Id: <20210909114106.141462-175-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bongsu Jeon [ Upstream commit 1d5b8d01db98abb8c176838fad73287366874582 ] memcpy should be executed only in case nla_len's value is greater than 0. Signed-off-by: Bongsu Jeon Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- tools/testing/selftests/nci/nci_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nci/nci_dev.c b/tools/testing/selftests/nci/nci_dev.c index 9687100f15ea..acd4125ff39f 100644 --- a/tools/testing/selftests/nci/nci_dev.c +++ b/tools/testing/selftests/nci/nci_dev.c @@ -110,7 +110,7 @@ static int send_cmd_mt_nla(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, na->nla_type = nla_type[cnt]; na->nla_len = nla_len[cnt] + NLA_HDRLEN; - if (nla_len > 0) + if (nla_len[cnt] > 0) memcpy(NLA_DATA(na), nla_data[cnt], nla_len[cnt]); prv_len = NLA_ALIGN(nla_len[cnt]) + NLA_HDRLEN; -- 2.30.2