Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1255258 > unrolled thread

[PATCH 0/3] Staging: wilc1000: Remove coccicheck warnings and error

Started byPunit Vara <punitvara@gmail.com>
First post2015-10-25 00:40 +0200
Last post2015-10-25 20:20 +0100
Articles 9 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] Staging: wilc1000: Remove coccicheck warnings and error Punit Vara <punitvara@gmail.com> - 2015-10-25 00:40 +0200
    [PATCH 3/3] Staging: wilc1000: Remove boolean comparision Punit Vara <punitvara@gmail.com> - 2015-10-25 00:40 +0200
    [PATCH 1/3] staging: wilc1000: Remove reference preceded by free Punit Vara <punitvara@gmail.com> - 2015-10-25 00:40 +0200
      Re: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free Greg KH <gregkh@linuxfoundation.org> - 2015-10-25 20:20 +0100
        Re: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free punit vara <punitvara@gmail.com> - 2015-10-25 20:40 +0100
          Re: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free punit vara <punitvara@gmail.com> - 2015-10-25 21:00 +0100
            Re: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free Greg KH <gregkh@linuxfoundation.org> - 2015-10-25 22:40 +0100
    [PATCH 2/3] Staging: wilc1000: Remove comparision of field address to NULL Punit Vara <punitvara@gmail.com> - 2015-10-25 00:40 +0200
      Re: [PATCH 2/3] Staging: wilc1000: Remove comparision of field  address to NULL Greg KH <gregkh@linuxfoundation.org> - 2015-10-25 20:20 +0100

#1255258 — [PATCH 0/3] Staging: wilc1000: Remove coccicheck warnings and error

FromPunit Vara <punitvara@gmail.com>
Date2015-10-25 00:40 +0200
Subject[PATCH 0/3] Staging: wilc1000: Remove coccicheck warnings and error
Message-ID<qnfDH-5tK-5@gated-at.bofh.it>
Punit Vara (3):
  staging: wilc1000: Remove reference preceded by free
  Staging: wilc1000: Remove comparision of field address to NULL
  Staging: wilc1000: Remove boolean comparision

 drivers/staging/wilc1000/host_interface.c         | 4 ++--
 drivers/staging/wilc1000/linux_wlan.c             | 8 ++++----
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++----
 3 files changed, 9 insertions(+), 10 deletions(-)

-- 
2.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1255259 — [PATCH 3/3] Staging: wilc1000: Remove boolean comparision

FromPunit Vara <punitvara@gmail.com>
Date2015-10-25 00:40 +0200
Subject[PATCH 3/3] Staging: wilc1000: Remove boolean comparision
Message-ID<qnfDH-5tK-9@gated-at.bofh.it>
In reply to#1255258
This patch is to the host_interface.c file that fixes up following
warning reported by coccicheck:

WARNING: Comparison to bool

Boolean tests do not need explicit comparison to true or false

Signed-off-by: Punit Vara <punitvara@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 38fead4..09a6c98 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1440,7 +1440,7 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
 			}
 		}
 
-		if (bNewNtwrkFound == true) {
+		if (bNewNtwrkFound) {
 			PRINT_D(HOSTINF_DBG, "New network found\n");
 
 			if (hif_drv->strWILC_UsrScanReq.u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) {
@@ -2714,7 +2714,7 @@ static void Handle_PowerManagement(struct host_if_drv *hif_drv,
 
 	strWID.id = (u16)WID_POWER_MANAGEMENT;
 
-	if (strPowerMgmtParam->enabled == true)
+	if (strPowerMgmtParam->enabled)
 		s8PowerMode = MIN_FAST_PS;
 	else
 		s8PowerMode = NO_POWERSAVE;
-- 
2.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1255260 — [PATCH 1/3] staging: wilc1000: Remove reference preceded by free

FromPunit Vara <punitvara@gmail.com>
Date2015-10-25 00:40 +0200
Subject[PATCH 1/3] staging: wilc1000: Remove reference preceded by free
Message-ID<qnfDH-5tK-11@gated-at.bofh.it>
In reply to#1255258
This patch is to the wilc_wfi_cfgoperations.c file that fixes up
following error reported by coccicheck:

ERROR: reference preceded by free on line 1219

For (params->seq_len) <= 0 memory is already freed when
(params->seq_len) >0 then memory was alloted. So there is no need to use
kfree whenever params->seq_len <=0 remove it and place kfree inside
(params->seq_len) >0 condition.

Signed-off-by: Punit Vara <punitvara@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index bcbf1bd..9b3cf04 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1216,11 +1216,10 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 
 				priv->wilc_ptk[key_index]->key = kmalloc(params->key_len, GFP_KERNEL);
 
-				kfree(priv->wilc_ptk[key_index]->seq);
-
-				if ((params->seq_len) > 0)
+				if ((params->seq_len) > 0) {
+					kfree(priv->wilc_ptk[key_index]->seq);
 					priv->wilc_ptk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
-
+				}
 				if (INFO) {
 					for (i = 0; i < params->key_len; i++)
 						PRINT_INFO(CFG80211_DBG, "Adding pairwise key value[%d] = %x\n", i, params->key[i]);
-- 
2.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1255535 — Re: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free

FromGreg KH <gregkh@linuxfoundation.org>
Date2015-10-25 20:20 +0100
SubjectRe: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free
Message-ID<qnyZI-6T8-17@gated-at.bofh.it>
In reply to#1255260
On Sun, Oct 25, 2015 at 04:01:23AM +0530, Punit Vara wrote:
> This patch is to the wilc_wfi_cfgoperations.c file that fixes up
> following error reported by coccicheck:
> 
> ERROR: reference preceded by free on line 1219
> 
> For (params->seq_len) <= 0 memory is already freed when
> (params->seq_len) >0 then memory was alloted. So there is no need to use
> kfree whenever params->seq_len <=0 remove it and place kfree inside
> (params->seq_len) >0 condition.
> 
> Signed-off-by: Punit Vara <punitvara@gmail.com>
> ---
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index bcbf1bd..9b3cf04 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -1216,11 +1216,10 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
>  
>  				priv->wilc_ptk[key_index]->key = kmalloc(params->key_len, GFP_KERNEL);
>  
> -				kfree(priv->wilc_ptk[key_index]->seq);
> -
> -				if ((params->seq_len) > 0)
> +				if ((params->seq_len) > 0) {
> +					kfree(priv->wilc_ptk[key_index]->seq);
>  					priv->wilc_ptk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
> -
> +				}

Are you sure about this?  It seems like you are changing the logic
here...

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1255539 — Re: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free

Frompunit vara <punitvara@gmail.com>
Date2015-10-25 20:40 +0100
SubjectRe: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free
Message-ID<qnzj4-6ZB-15@gated-at.bofh.it>
In reply to#1255535
On Mon, Oct 26, 2015 at 12:42 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sun, Oct 25, 2015 at 04:01:23AM +0530, Punit Vara wrote:
>> This patch is to the wilc_wfi_cfgoperations.c file that fixes up
>> following error reported by coccicheck:
>>
>> ERROR: reference preceded by free on line 1219
>>
>> For (params->seq_len) <= 0 memory is already freed when
>> (params->seq_len) >0 then memory was alloted. So there is no need to use
>> kfree whenever params->seq_len <=0 remove it and place kfree inside
>> (params->seq_len) >0 condition.
>>
>> Signed-off-by: Punit Vara <punitvara@gmail.com>
>> ---
>>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++----
>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>> index bcbf1bd..9b3cf04 100644
>> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>> @@ -1216,11 +1216,10 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
>>
>>                               priv->wilc_ptk[key_index]->key = kmalloc(params->key_len, GFP_KERNEL);
>>
>> -                             kfree(priv->wilc_ptk[key_index]->seq);
>> -
>> -                             if ((params->seq_len) > 0)
>> +                             if ((params->seq_len) > 0) {
>> +                                     kfree(priv->wilc_ptk[key_index]->seq);
>>                                       priv->wilc_ptk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
>> -
>> +                             }
>
> Are you sure about this?  It seems like you are changing the logic
> here...
>
Yes this time I am quite confident here . On This file line no 1177
already freed the allocation of memory ..On the following line if
(params->seq_len) > 0 then memory is allotted but if it is not then
memory allocation remains free only. So here kfree is not required
outside of the if condition. It should be inside the if condition
because for   (params->seq_len) > 0 memory is already allotted at line
followed by 1177. Kindly look at it once.

Thanks :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1255543 — Re: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free

Frompunit vara <punitvara@gmail.com>
Date2015-10-25 21:00 +0100
SubjectRe: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free
Message-ID<qnzCp-76e-1@gated-at.bofh.it>
In reply to#1255539
On Mon, Oct 26, 2015 at 1:01 AM, punit vara <punitvara@gmail.com> wrote:
> On Mon, Oct 26, 2015 at 12:42 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> On Sun, Oct 25, 2015 at 04:01:23AM +0530, Punit Vara wrote:
>>> This patch is to the wilc_wfi_cfgoperations.c file that fixes up
>>> following error reported by coccicheck:
>>>
>>> ERROR: reference preceded by free on line 1219
>>>
>>> For (params->seq_len) <= 0 memory is already freed when
>>> (params->seq_len) >0 then memory was alloted. So there is no need to use
>>> kfree whenever params->seq_len <=0 remove it and place kfree inside
>>> (params->seq_len) >0 condition.
>>>
>>> Signed-off-by: Punit Vara <punitvara@gmail.com>
>>> ---
>>>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++----
>>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>>> index bcbf1bd..9b3cf04 100644
>>> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>>> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>>> @@ -1216,11 +1216,10 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
>>>
>>>                               priv->wilc_ptk[key_index]->key = kmalloc(params->key_len, GFP_KERNEL);
>>>
>>> -                             kfree(priv->wilc_ptk[key_index]->seq);
>>> -
>>> -                             if ((params->seq_len) > 0)
>>> +                             if ((params->seq_len) > 0) {
>>> +                                     kfree(priv->wilc_ptk[key_index]->seq);
>>>                                       priv->wilc_ptk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
>>> -
>>> +                             }
>>
>> Are you sure about this?  It seems like you are changing the logic
>> here...
>>
> Yes this time I am quite confident here . On This file line no 1177
> already freed the allocation of memory ..On the following line if
> (params->seq_len) > 0 then memory is allotted but if it is not then
> memory allocation remains free only. So here kfree is not required
> outside of the if condition. It should be inside the if condition
> because for   (params->seq_len) > 0 memory is already allotted at line
> followed by 1177. Kindly look at it once.
>
> Thanks :-)
Again I went back thinking Greg who is stable kernel maintainer who
doubts about logic .So I again go through these code , you are right .
What you ignore this change and apply this patch ?
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9b3cf04..3ab7d3e 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1174,9 +1174,9 @@ static int add_key(struct wiphy *wiphy, struct
net_device *netdev, u8 key_index,
                                memcpy(priv->wilc_gtk[key_index]->key,
params->key, params->key_len);

                                /* if there has been previous
allocation for the same index through its seq, free that memory and
allocate again*/
-                               kfree(priv->wilc_gtk[key_index]->seq);

                                if ((params->seq_len) > 0) {
+                                       kfree(priv->wilc_gtk[key_index]->seq);
                                        priv->wilc_gtk[key_index]->seq
= kmalloc(params->seq_len, GFP_KERNEL);

memcpy(priv->wilc_gtk[key_index]->seq, params->seq, params->seq_len);
                                }


?? May send this patch ? I think it will not change the logic .
Comment me if I am wrong
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1255564 — Re: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free

FromGreg KH <gregkh@linuxfoundation.org>
Date2015-10-25 22:40 +0100
SubjectRe: [PATCH 1/3] staging: wilc1000: Remove reference preceded by free
Message-ID<qnBbc-87D-5@gated-at.bofh.it>
In reply to#1255543
On Mon, Oct 26, 2015 at 01:29:42AM +0530, punit vara wrote:
> On Mon, Oct 26, 2015 at 1:01 AM, punit vara <punitvara@gmail.com> wrote:
> > On Mon, Oct 26, 2015 at 12:42 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >> On Sun, Oct 25, 2015 at 04:01:23AM +0530, Punit Vara wrote:
> >>> This patch is to the wilc_wfi_cfgoperations.c file that fixes up
> >>> following error reported by coccicheck:
> >>>
> >>> ERROR: reference preceded by free on line 1219
> >>>
> >>> For (params->seq_len) <= 0 memory is already freed when
> >>> (params->seq_len) >0 then memory was alloted. So there is no need to use
> >>> kfree whenever params->seq_len <=0 remove it and place kfree inside
> >>> (params->seq_len) >0 condition.
> >>>
> >>> Signed-off-by: Punit Vara <punitvara@gmail.com>
> >>> ---
> >>>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++----
> >>>  1 file changed, 3 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> >>> index bcbf1bd..9b3cf04 100644
> >>> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> >>> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> >>> @@ -1216,11 +1216,10 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
> >>>
> >>>                               priv->wilc_ptk[key_index]->key = kmalloc(params->key_len, GFP_KERNEL);
> >>>
> >>> -                             kfree(priv->wilc_ptk[key_index]->seq);
> >>> -
> >>> -                             if ((params->seq_len) > 0)
> >>> +                             if ((params->seq_len) > 0) {
> >>> +                                     kfree(priv->wilc_ptk[key_index]->seq);
> >>>                                       priv->wilc_ptk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
> >>> -
> >>> +                             }
> >>
> >> Are you sure about this?  It seems like you are changing the logic
> >> here...
> >>
> > Yes this time I am quite confident here . On This file line no 1177
> > already freed the allocation of memory ..On the following line if
> > (params->seq_len) > 0 then memory is allotted but if it is not then
> > memory allocation remains free only. So here kfree is not required
> > outside of the if condition. It should be inside the if condition
> > because for   (params->seq_len) > 0 memory is already allotted at line
> > followed by 1177. Kindly look at it once.
> >
> > Thanks :-)
> Again I went back thinking Greg who is stable kernel maintainer who
> doubts about logic .So I again go through these code , you are right .
> What you ignore this change and apply this patch ?
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index 9b3cf04..3ab7d3e 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -1174,9 +1174,9 @@ static int add_key(struct wiphy *wiphy, struct
> net_device *netdev, u8 key_index,
>                                 memcpy(priv->wilc_gtk[key_index]->key,
> params->key, params->key_len);
> 
>                                 /* if there has been previous
> allocation for the same index through its seq, free that memory and
> allocate again*/
> -                               kfree(priv->wilc_gtk[key_index]->seq);
> 
>                                 if ((params->seq_len) > 0) {
> +                                       kfree(priv->wilc_gtk[key_index]->seq);
>                                         priv->wilc_gtk[key_index]->seq
> = kmalloc(params->seq_len, GFP_KERNEL);
> 
> memcpy(priv->wilc_gtk[key_index]->seq, params->seq, params->seq_len);
>                                 }
> 
> 
> ?? May send this patch ? I think it will not change the logic .
> Comment me if I am wrong

I don't really see the need for this change at all.  It's not fixing
anything, and the kfree call is "free" we don't need to worry about
that, so please, just leave it as-is for now, there is _so_ many other
real things to do to fix up this driver than to worry about
non-optimizing things like this.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1255261 — [PATCH 2/3] Staging: wilc1000: Remove comparision of field address to NULL

FromPunit Vara <punitvara@gmail.com>
Date2015-10-25 00:40 +0200
Subject[PATCH 2/3] Staging: wilc1000: Remove comparision of field address to NULL
Message-ID<qnfDH-5tK-3@gated-at.bofh.it>
In reply to#1255258
This is patch to the linux_wlan file that fixes up following error
reported by coccicheck :

ERROR: test of a variable/field address

Signed-off-by: Punit Vara <punitvara@gmail.com>
---
 drivers/staging/wilc1000/linux_wlan.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b879b8b..1b0f89c 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -907,7 +907,7 @@ void wilc1000_wlan_deinit(struct wilc *nic)
 		disable_sdio_interrupt();
 		mutex_unlock(&g_linux_wlan->hif_cs);
 #endif
-		if (&g_linux_wlan->txq_event != NULL)
+		if (!(&g_linux_wlan->txq_event))
 			up(&g_linux_wlan->txq_event);
 
 		PRINT_D(INIT_DBG, "Deinitializing Threads\n");
@@ -969,10 +969,10 @@ static int wlan_deinit_locks(struct wilc *nic)
 {
 	PRINT_D(INIT_DBG, "De-Initializing Locks\n");
 
-	if (&g_linux_wlan->hif_cs != NULL)
+	if (!(&g_linux_wlan->hif_cs))
 		mutex_destroy(&g_linux_wlan->hif_cs);
 
-	if (&g_linux_wlan->rxq_cs != NULL)
+	if (!(&g_linux_wlan->rxq_cs))
 		mutex_destroy(&g_linux_wlan->rxq_cs);
 
 	return 0;
@@ -1037,7 +1037,7 @@ static void wlan_deinitialize_threads(struct wilc *nic)
 	g_linux_wlan->close = 1;
 	PRINT_D(INIT_DBG, "Deinitializing Threads\n");
 
-	if (&g_linux_wlan->txq_event != NULL)
+	if (!(&g_linux_wlan->txq_event))
 		up(&g_linux_wlan->txq_event);
 
 	if (g_linux_wlan->txq_thread != NULL) {
-- 
2.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1255533 — Re: [PATCH 2/3] Staging: wilc1000: Remove comparision of field address to NULL

FromGreg KH <gregkh@linuxfoundation.org>
Date2015-10-25 20:20 +0100
SubjectRe: [PATCH 2/3] Staging: wilc1000: Remove comparision of field address to NULL
Message-ID<qnyZH-6T8-1@gated-at.bofh.it>
In reply to#1255261
On Sun, Oct 25, 2015 at 04:01:24AM +0530, Punit Vara wrote:
> This is patch to the linux_wlan file that fixes up following error
> reported by coccicheck :
> 
> ERROR: test of a variable/field address
> 
> Signed-off-by: Punit Vara <punitvara@gmail.com>
> ---
>  drivers/staging/wilc1000/linux_wlan.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Does not apply to my tree anymore, I think someone else already did this
:(
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web