lkml.org 
[lkml]   [2019]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] staging: rtl8192u: remove redundant null check on array 'data'
Date
From: Colin Ian King <colin.king@canonical.com>

The NULL check on ram->u.wpa_ie.data is redudant as data is
zero-length array and is not a pointer, so it can't be null.
Remove the check.

Addresses-Coverity: ("Array compared against 0")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 944c8894f9ff..c4a4f118f547 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -2659,8 +2659,7 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
{
u8 *buf;

- if (param->u.wpa_ie.len > MAX_WPA_IE_LEN ||
- (param->u.wpa_ie.len && param->u.wpa_ie.data == NULL))
+ if (param->u.wpa_ie.len > MAX_WPA_IE_LEN || param->u.wpa_ie.len)
return -EINVAL;

if (param->u.wpa_ie.len) {
--
2.20.1
\
 
 \ /
  Last update: 2019-04-04 11:34    [W:0.058 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site