linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] rsi: fix missing null pointer check from a failed ieee80211_probereq_get call
@ 2019-02-21 12:35 Colin King
  2019-02-28  8:29 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-02-21 12:35 UTC (permalink / raw)
  To: Amitkumar Karwar, Siva Rebbagondla, Kalle Valo, David S . Miller,
	linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The call to ieee80211_probereq_get can return NULL if a skb allocation
fails, so add a null pointer check and free an earlier skb on the error
exit return path.

Fixes: 7fdcb8e12660 ("rsi: add support for hardware scan offload")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/rsi/rsi_91x_mgmt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
index 8c17842ac507..844f2fac298f 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
@@ -1726,6 +1726,10 @@ int rsi_send_bgscan_probe_req(struct rsi_common *common,
 
 	probereq_skb = ieee80211_probereq_get(common->priv->hw, vif->addr, ssid,
 					      ssid_len, scan_req->ie_len);
+	if (!probereq_skb) {
+		dev_kfree_skb(skb);
+		return -ENOMEM;
+	}
 
 	memcpy(&skb->data[frame_len], probereq_skb->data, probereq_skb->len);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] rsi: fix missing null pointer check from a failed ieee80211_probereq_get call
  2019-02-21 12:35 [PATCH][next] rsi: fix missing null pointer check from a failed ieee80211_probereq_get call Colin King
@ 2019-02-28  8:29 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-02-28  8:29 UTC (permalink / raw)
  To: Colin King
  Cc: Amitkumar Karwar, Siva Rebbagondla, David S . Miller,
	linux-wireless, netdev, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The call to ieee80211_probereq_get can return NULL if a skb allocation
> fails, so add a null pointer check and free an earlier skb on the error
> exit return path.
> 
> Fixes: 7fdcb8e12660 ("rsi: add support for hardware scan offload")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied to wireless-drivers-next.git, thanks.

74ee436f9581 rsi: fix missing null pointer check from a failed ieee80211_probereq_get call

-- 
https://patchwork.kernel.org/patch/10824023/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-28  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 12:35 [PATCH][next] rsi: fix missing null pointer check from a failed ieee80211_probereq_get call Colin King
2019-02-28  8:29 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).