All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregory.greenman@intel.com
To: kvalo@kernel.org
Cc: johannes@sipsolutions.net, gregory.greenman@intel.com,
	linux-wireless@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 10/10] iwlwifi: mei: fix potential NULL-ptr deref
Date: Tue, 17 May 2022 12:05:14 +0300	[thread overview]
Message-ID: <20220517120045.90c1b1fd534e.Ibb42463e74d0ec7d36ec81df22e171ae1f6268b0@changeid> (raw)
In-Reply-To: <20220517090514.211796-1-gregory.greenman@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

If SKB allocation fails, continue rather than using the NULL
pointer.

Coverity CID: 1497650

Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mei/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c
index 3d2eb15a9662..357f14626cf4 100644
--- a/drivers/net/wireless/intel/iwlwifi/mei/main.c
+++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c
@@ -1020,6 +1020,8 @@ static void iwl_mei_handle_sap_data(struct mei_cl_device *cldev,
 
 		/* We need enough room for the WiFi header + SNAP + IV */
 		skb = netdev_alloc_skb(netdev, len + QOS_HDR_IV_SNAP_LEN);
+		if (!skb)
+			continue;
 
 		skb_reserve(skb, QOS_HDR_IV_SNAP_LEN);
 		ethhdr = skb_push(skb, sizeof(*ethhdr));
-- 
2.35.1


  parent reply	other threads:[~2022-05-17  9:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  9:05 [PATCH 00/10] iwlwifi: updates intended for v5.18 2022-05-17 gregory.greenman
2022-05-17  9:05 ` [PATCH 01/10] iwlwifi: pcie: simplify MSI-X cause mapping gregory.greenman
2022-05-17  9:05 ` [PATCH 02/10] iwlwifi: mvm: use NULL instead of ERR_PTR when parsing wowlan status gregory.greenman
2022-05-17  9:05 ` [PATCH 03/10] iwlwifi: mvm: clean up authorized condition gregory.greenman
2022-05-17  9:05 ` [PATCH 04/10] iwlwifi: fw: init SAR GEO table only if data is present gregory.greenman
2022-05-17  9:05 ` [PATCH 05/10] iwlwifi: mvm: fix assert 1F04 upon reconfig gregory.greenman
2022-05-17  9:05 ` [PATCH 06/10] iwlwifi: mvm: add OTP info in case of init failure gregory.greenman
2022-05-17  9:05 ` [PATCH 07/10] iwlwifi: mvm: always tell the firmware to accept MCAST frames in BSS gregory.greenman
2022-05-17  9:05 ` [PATCH 08/10] iwlwifi: mvm: remove vif_count gregory.greenman
2022-05-17  9:05 ` [PATCH 09/10] iwlwifi: mei: clear the sap data header before sending gregory.greenman
2022-05-17  9:05 ` gregory.greenman [this message]
2022-05-17  9:38 ` [PATCH 00/10] iwlwifi: updates intended for v5.18 2022-05-17 Greenman, Gregory

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220517120045.90c1b1fd534e.Ibb42463e74d0ec7d36ec81df22e171ae1f6268b0@changeid \
    --to=gregory.greenman@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.