Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: wlan-ng: Fix smatch warning potential null reference

This patch fixes potential null dereference 'wlandev' in wlan-ng driver.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Tugce Sirin <ztugcesirin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tugce Sirin and committed by
Greg Kroah-Hartman
d8720f8e 168934c9

+1 -1
+1 -1
drivers/staging/wlan-ng/prism2sta.c
··· 1924 1924 hw = kzalloc(sizeof(hfa384x_t), GFP_KERNEL); 1925 1925 1926 1926 if (!wlandev || !hw) { 1927 - netdev_err(wlandev->netdev, "%s: Memory allocation failure.\n", dev_info); 1927 + pr_err("%s: Memory allocation failure.\n", dev_info); 1928 1928 kfree(wlandev); 1929 1929 kfree(hw); 1930 1930 return NULL;