Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2446825rdg; Mon, 14 Aug 2023 02:52:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBeI2x0YYoFWO2Kr+SdiaG5C/6UqltgGpffz7C23uhogttmYyfr8i/LQKxPZ+NLZKl/hKq X-Received: by 2002:a17:902:e545:b0:1b7:f64b:379b with SMTP id n5-20020a170902e54500b001b7f64b379bmr10622207plf.17.1692006731629; Mon, 14 Aug 2023 02:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692006731; cv=none; d=google.com; s=arc-20160816; b=LQSaFASGRR6swugy1nlozW8lEQDjY5otnhAQjZ+oTKfL+JAz1MNGMhRG8BMY4CpBHE Sbgm9b01CKq1g+Y2AmFi6xsn33gulWJqrnLXBQP3uxPyRf97IEkwenm/6ySNlOtecID/ sR6woFPh/GBNbWynWlMKIoDRy3Ckg0c4Vx2c7E5Y1teVlHqRFmDuvizrAx3S6qZaG4lR vzM+Cf7AvaTtdUkQkuroTKqcQIcdmfFZ4D427NVvLZWutMExek9/+7d01MMF+h+mr9AF XYNLjM+Jl9PEVhC890EsRKp5njmLtLn4f09Tsxnmlo+s5bRhiL3LlKhO1fYz94ePDy7X DSJg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=gsKsd3l5SMWpT7BBmAiDIr5lJKy4P1L92U+IeCrSjBI=; fh=QOWwfG4FVSnd9AIOShUSAUXRfIYL9U5QEVubBaOIArY=; b=lmRyNOmISFdnhh2wwy3W8QSpaelp5ItGQZcPMwEOgoNRHMjc3oiVawDoPnl1re5uFV QdUYiZgHhpzBXQsu5v5W6I5rod2uXopWjwfsMltswKmojcZGbzrE7hdKK9xECHd8ORTd ebGhu8IoClrVPFbat0cJPU1YTEDMqE+4mhqoU+9A4IBHBOEEA44v2iKT7ewcRWxAve3Z S4pqkPCc5NpBDQoQu7xhvbvX1drFCmAqN9Vpw85QBOP6RvC81QPPgP2N5/NEvmeTVBTN bout6JXJqmMFlzbvgCyaeh+y+YFlvKnT58yWCoqfs9D8jhxrRl89RHB7kuvreR/Jq3RM xinQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=bV0Esw3Q; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a170902bd4600b001bb83654b3dsi7701285plx.217.2023.08.14.02.52.01; Mon, 14 Aug 2023 02:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=bV0Esw3Q; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233546AbjHNJWs (ORCPT + 54 others); Mon, 14 Aug 2023 05:22:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235318AbjHNJWg (ORCPT ); Mon, 14 Aug 2023 05:22:36 -0400 Received: from forward101c.mail.yandex.net (forward101c.mail.yandex.net [178.154.239.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9505CD7 for ; Mon, 14 Aug 2023 02:22:31 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-45.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-45.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:c83:0:640:84f9:0]) by forward101c.mail.yandex.net (Yandex) with ESMTP id 3FA29600F8; Mon, 14 Aug 2023 12:22:29 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-45.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id SMa43HsW0uQ0-EMm3AVlM; Mon, 14 Aug 2023 12:22:28 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1692004948; bh=gsKsd3l5SMWpT7BBmAiDIr5lJKy4P1L92U+IeCrSjBI=; h=Message-ID:Date:Cc:Subject:To:From; b=bV0Esw3QIbXJTDXobQXv+BjX63A+HSm/RmcVHQtZ4AQkzg+loxnRXowfFFqLRv9/d wO677W5j4Mgv1OznZLYPkdAVPD/MlAb6xwppSK4eKed5JhJ77JxOCKfErS5449/Eb/ zuzCxeJSBx64O1ugKukTqM1kmBCiSwXUOUmXBMLI= Authentication-Results: mail-nwsmtp-smtp-production-main-45.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Johannes Berg Cc: Kalle Valo , linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org, Dmitry Antipov Subject: [PATCH] wifi: mac80211_hwsim: do not ignore the value returned by nla_put_u32() Date: Mon, 14 Aug 2023 12:21:17 +0300 Message-ID: <20230814092128.14330-1-dmantipov@yandex.ru> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In 'mac80211_hwsim_vendor_cmd_test()', do not ignore the value returned by 'nla_put_u32'. This follows commit b970ac68e0c4 ("wifi: mac80211_hwsim: check the return value of nla_put_u32"). Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- drivers/net/wireless/virtual/mac80211_hwsim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index f446fd0e8cd0..2a3393a47bf2 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -597,9 +597,9 @@ static int mac80211_hwsim_vendor_cmd_test(struct wiphy *wiphy, /* skb_put() or nla_put() will fill up data within * NL80211_ATTR_VENDOR_DATA */ - nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_TEST, val + 2); + err = nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_TEST, val + 2); - return cfg80211_vendor_cmd_reply(skb); + return err ? err : cfg80211_vendor_cmd_reply(skb); } static struct wiphy_vendor_command mac80211_hwsim_vendor_commands[] = { -- 2.41.0