Staging: rtl8192e: Fix potential NULL pointer dereference

We need to make sure the struct rtllib_device pointer ieee is not NULL
after the goto rx_dropped label since it is dereferenced there.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: rtl8192ee: Correct bitmask in comparsion

The issue is discovered by static checker. The proposed change (0x000c0
-> 0x000c) is likely correct because:
1. 16-bit `map` holds value coming from struct
ieee80211_vht_mcs_info.tx_mcs_map, which is described so: "TX MCS map 2
bits for each stream, total 8 streams". The changed code refers to case
of 2 TX streams, and 0x000c mask filters two bits related to the second
stream. Some codelines below 0x0003 mask is used to test first stream.
2. Mask 0x000c is used 3 more times in that place.
3. Specifying 5 digits of hex value is uncommon, especially while working
with `u16` variable. So likely the trailing zero is a typo.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78041
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: emxx_udc: Fix build error

‘strict_strtol’ is deprecated. Use kstrtol instead. Fixes the following
build error:
drivers/staging/emxx_udc/emxx_udc.c:3288:3: error: implicit declaration of function ‘strict_strtol’

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: gdm72xx: use consistent style for header guards

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: gdm72xx: clean up endianness conversions

This patch cleans up the endianness conversions in the gdm72xx driver:
- Directly use the generic byte-reordering macros for endianness
  conversion instead of some custom-defined macros.
- Convert values on the constant side instead of the variable side when
  appropriate.
- Add endianness annotations.

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: gdm72xx: remove unused code

Remove code surrounded by otherwise unused #define LOOPBACK_TEST

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: gdm72xx: add help text to Kconfig

The descriptions are provided by GCT Semiconductor, Inc.

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: gdm72xx: Use net_device_stats from struct net_device

Instead of using an own copy of struct net_device_stats in struct nic,
use stats from struct net_device. Also remove the thus unnecessary
.ndo_get_stats function, as it would now just return netdev->stats,
which is the default in dev_get_stats().

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: gdm72xx: Remove unnecessary memset of netdev private data

The memory for struct net_device private data is allocated using
kzalloc/vzalloc in alloc_netdev_mqs, thus there is no need to zero it
again in the driver.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: wlan-ng: Use net_device_stats from struct net_device

Instead of using an own copy of struct net_device_stats in struct
wlandevice, use stats from struct net_device. Also remove the thus
unnecessary .ndo_get_stats function, as it would now just return
netdev->stats, which is the default in dev_get_stats().

Furthermore, convert prefix increment of stats counters to the more
common postfix increment idiom.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: wlan-ng/prism2fw.c: Add blank line after declarations

Fix checkpatch.pl warnings due to missing blank line after declarations

Signed-off-by: Matt Kurz <matt@ninezulu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: fixed "foo* bar should be foo * bar" in dgap.c

clean up checkpatch.pl error:
ERROR: "foo* bar" should be "foo *bar"

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: remove "return" statement in void function

clean up checkpatch warning:
WARNING: void function return statements are not generally useful

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: Adds a blank line after declaration

clean up checkpatch.pl warning:
WARNING: Missing a blank line after declarations

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: remove unneccessary dgap_init_pci() function

The dgap_init_pci() calls only pci_register_driver().
It doesn't need to make a function for that.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: remove unused waitqueues

dgap_dl_wait and kme_wait are not used in dgap.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: use kzalloc instead of kmalloc/memset

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: remove redundant NULL check in dgap_tty_init()

The brd is already checked by earlier function in dgap_init_one().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: remove redundant null check for kfree()

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: Fix unsigned value for less than zero

The "un->un_open_count" is unsigned variable, so it cannot
be less than zero.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>