All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Colin Ian King <colin.king@canonical.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL for 4.14 11/84] staging: rtl8822be: fix missing null check on dev_alloc_skb return
Date: Sat, 3 Mar 2018 22:26:06 +0000	[thread overview]
Message-ID: <20180303222518.26271-11-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180303222518.26271-1-alexander.levin@microsoft.com>

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

[ Upstream commit 3eb23426e1749a0483bc4c9b18e51f657569e3ed ]

dev_alloc_skb can potentially return NULL, so add a null check to
avoid a null pointer dereference on skb

Detected by CoverityScan, CID#1454558 ("Dereference on null return")

Fixes: 7e5b796cde7e ("staging: r8822be: Add the driver code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/staging/rtlwifi/rtl8822be/fw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/rtlwifi/rtl8822be/fw.c b/drivers/staging/rtlwifi/rtl8822be/fw.c
index a2cc54866e79..acabb2470d55 100644
--- a/drivers/staging/rtlwifi/rtl8822be/fw.c
+++ b/drivers/staging/rtlwifi/rtl8822be/fw.c
@@ -464,6 +464,8 @@ bool rtl8822b_halmac_cb_write_data_rsvd_page(struct rtl_priv *rtlpriv, u8 *buf,
 	int count;
 
 	skb = dev_alloc_skb(size);
+	if (!skb)
+		return false;
 	memcpy((u8 *)skb_put(skb, size), buf, size);
 
 	if (!_rtl8822be_send_bcn_or_cmd_packet(rtlpriv->hw, skb, BEACON_QUEUE))
-- 
2.14.1

  parent reply	other threads:[~2018-03-03 22:26 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-03 22:26 [PATCH AUTOSEL for 4.14 01/84] drm/edid: set ELD connector type in drm_edid_to_eld() Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 03/84] video/hdmi: Allow "empty" HDMI infoframes Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 02/84] dma-buf/fence: Fix lock inversion within dma-fence-array Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 05/84] HID: elo: clear BTN_LEFT mapping Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 04/84] HID: multitouch: Only look at non touch fields in first packet of a frame Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 06/84] iwlwifi: mvm: rs: don't override the rate history in the search cycle Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 08/84] clk: meson: gxbb: fix wrong clock for SARADC/SANA Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 07/84] ARM: dts: koelsch: Move cec_clock to root node Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 09/84] ARM: dts: exynos: Correct Trats2 panel reset line Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 10/84] drm/amdgpu: fix get_max_engine_clock_in_mhz Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 12/84] typec: tcpm: fusb302: Resolve out of order messaging events Sasha Levin
2018-03-03 22:26 ` Sasha Levin [this message]
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 13/84] USB: ledtrig-usbport: fix of-node leak Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 15/84] sched: Stop resched_cpu() from sending IPIs to offline CPUs Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 14/84] sched: Stop switched_to_rt() " Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 17/84] crypto: cavium - fix memory leak on info Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 16/84] crypto: ecc - Fix NULL pointer deref. on no default_rng Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 18/84] test_firmware: fix setting old custom fw path back on exit Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 20/84] net: ieee802154: adf7242: Fix bug if defined DEBUG Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 19/84] ASoC: fsl_ssi: only enable proper channel slots in AC'97 mode Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 22/84] net: xfrm: allow clearing socket xfrm policies Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 21/84] rtc: brcmstb-waketimer: fix error handling in brcmstb_waketmr_probe() Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 23/84] mtd: nand: fix interpretation of NAND_CMD_NONE in nand_command[_lp]() Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 24/84] net: thunderx: Set max queue count taking XDP_TX into account Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 25/84] ARM: dts: am335x-pepper: Fix the audio CODEC's reset pin Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 26/84] ARM: dts: omap3-n900: " Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 27/84] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0 Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 29/84] xfrm: Fix xfrm_replay_overflow_offload_esn Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 28/84] userns: Don't fail follow_automount based on s_user_ns Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 30/84] leds: pm8058: Silence pointer to integer size warning Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 31/84] clk: ti: clkctrl: add support for retrying failed init Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 32/84] ASoC: tlv320aic31xx: Handle inverted BCLK in non-DSP modes Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 34/84] power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_registers()' Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 33/84] power: supply: ab8500_charger: Fix an error handling path Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 36/84] iio: adc: ina2xx: Shift bus voltage register to mask flag bits Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 35/84] drm/etnaviv: make THERMAL selectable Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 37/84] iio: health: max30102: Add power enable parameter to get_temp function Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 38/84] ath10k: update tdls teardown state to target Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 39/84] cpufreq: Fix governor module removal race Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 40/84] dmaengine: bcm2835-dma: Use vchan_terminate_vdesc() instead of desc_free Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 41/84] dmaengine: amba-pl08x: " Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 42/84] drm/amdgpu:fix random missing of FLR NOTIFY Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 43/84] scsi: ses: don't ask for diagnostic pages repeatedly during probe Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 44/84] pwm: stmpe: Fix wrong register offset for hwpwm=2 case Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 45/84] drm/sun4i: Fix format mask in DE2 driver Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 46/84] pinctrl: sh-pfc: r8a7791: Add can_clk function Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 47/84] pinctrl: sh-pfc: r8a7795-es1: Fix MOD_SEL1 bit[25:24] to 0x3 when using STP_ISEN_1_D Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 48/84] perf annotate: Fix unnecessary memory allocation for s390x Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 49/84] perf annotate: Fix objdump comment parsing for Intel mov dissassembly Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 50/84] iwlwifi: mvm: avoid dumping assert log when device is stopped Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 51/84] drm/amdgpu:fix virtual dce bug Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 53/84] mwifiex: cfg80211: do not change virtual interface during scan processing Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 52/84] clk: qcom: msm8916: fix mnd_width for codec_digcodec Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 54/84] ath10k: fix invalid STS_CAP_OFFSET_MASK Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 56/84] spi: sun6i: disable/unprepare clocks on remove Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 55/84] tools/usbip: fixes build with musl libc toolchain Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 57/84] bnxt_en: Don't print "Link speed -1 no longer supported" messages Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 58/84] scsi: core: scsi_get_device_flags_keyed(): Always return device flags Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 59/84] scsi: devinfo: apply to HP XP the same flags as Hitachi VSP Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 61/84] media: vsp1: Prevent suspending and resuming DRM pipelines Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 60/84] scsi: dh: add new rdac devices Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 62/84] dm raid: fix raid set size revalidation Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 63/84] media: cpia2: Fix a couple off by one bugs Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 64/84] media: davinci: vpif_capture: add NULL check on devm_kzalloc return value Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 66/84] net: sched: drop qdisc_reset from dev_graft_qdisc Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 65/84] virtio_net: Disable interrupts if napi_complete_done rescheduled napi Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 67/84] veth: set peer GSO values Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 69/84] powerpc/modules: Don't try to restore r2 after a sibling call Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 68/84] drm/amdkfd: Fix memory leaks in kfd topology Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 70/84] powerpc/64: Don't trace irqs-off at interrupt return to soft-disabled context Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 71/84] arm64: dts: renesas: salvator-common: Add EthernetAVB PHY reset Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 72/84] agp/intel: Flush all chipset writes after updating the GGTT Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 74/84] mac80211: remove BUG() when interface type is invalid Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 73/84] mac80211_hwsim: enforce PS_MANUAL_POLL to be set after PS_ENABLED Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 75/84] crypto: caam/qi - use correct print specifier for size_t Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 76/84] ASoC: nuc900: Fix a loop timeout test Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 77/84] mmc: mmc_test: Ensure command queue is disabled for testing Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 78/84] Fix misannotated out-of-line _copy_to_user() Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 79/84] ipvlan: add L2 check for packets arriving via virtual devices Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 80/84] rcutorture/configinit: Fix build directory error message Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 81/84] locking/locktorture: Fix num reader/writer corner cases Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 82/84] ima: relax requiring a file signature for new files with zero length Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 83/84] IB/mlx5: revisit -Wmaybe-uninitialized warning Sasha Levin
2018-03-03 22:26 ` [PATCH AUTOSEL for 4.14 84/84] dmaengine: qcom_hidma: check pending interrupts Sasha Levin

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=20180303222518.26271-11-alexander.levin@microsoft.com \
    --to=alexander.levin@microsoft.com \
    --cc=colin.king@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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.