From patchwork Sun Jun 4 09:11:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 689209 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40CE9C7EE23 for ; Sun, 4 Jun 2023 09:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbjFDJMD (ORCPT ); Sun, 4 Jun 2023 05:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbjFDJMC (ORCPT ); Sun, 4 Jun 2023 05:12:02 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0D791A7 for ; Sun, 4 Jun 2023 02:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685869921; x=1717405921; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W+5a/XY0UWItE274Ga9fF+CH4rS0N9eDxGlBPNGGrE8=; b=SycF8cCZU4fsayccqdbwexZg8k1/IDUkfgNabvzMeVooqxWYXumQ+FwW Heg3ay9Re4YAmNEw196f+G5v2zqtqpX7oYqYdY81zmphW/bPQrjgkl+oR emAYWN8Rr6NYQvYeekMTExBy1Pbv2DfYdmlTPTOc+drjCyyHhr122H3vG nR/S0XJsSf68t/1qi9RHhFkjGforewp2XRgKBS3ntvM/vC2tRg2zvmZjY BpHy9LPfsRiv1GPdJAbBR0+vl6GA0NRfPjdnG43VX26N8LYfi/sf6EtKy 2rLKJPADLYX5hCvQhKLq6IBOUkh0yDyI7zSl9bGOJCcJOQFVQc2hTkVRD w==; X-IronPort-AV: E=McAfee;i="6600,9927,10730"; a="336526515" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="336526515" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2023 02:12:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10730"; a="820804591" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="820804591" Received: from yfruchte-mobl3.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.219.60]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2023 02:11:59 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Mukesh Sisodiya , Gregory Greenman Subject: [PATCH 07/16] wifi: mac80211_hwsim: check the return value of nla_put_u32 Date: Sun, 4 Jun 2023 12:11:19 +0300 Message-Id: <20230604120651.de5168568cf6.Ie16442af9be879fd835506ba5dade780edecfb60@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230604091128.609335-1-gregory.greenman@intel.com> References: <20230604091128.609335-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Mukesh Sisodiya Check the return value of nla_put_u32() and handle it accordingly. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman --- drivers/net/wireless/virtual/mac80211_hwsim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index 5ff193bcd4b9..b06a6e78169d 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -582,8 +582,9 @@ static int mac80211_hwsim_vendor_cmd_test(struct wiphy *wiphy, */ /* Add vendor data */ - nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_TEST, val + 1); - + err = nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_TEST, val + 1); + if (err) + return err; /* Send the event - this will call nla_nest_end() */ cfg80211_vendor_event(skb, GFP_KERNEL); }