lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 29 Dec 2014 00:20:29 -0600
From:	Larry Finger <Larry.Finger@...inger.net>
To:	Serguey Parkhomovsky <sergueyparkhomovsky@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	navin patidar <navin.patidar@...il.com>,
	Elena Oat <oat.elena@...il.com>, Tim Jester-Pfadt <t.jp@....de>
CC:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8188eu: rtw_mlme.c: fix sparse warning

On 12/28/2014 11:47 PM, Serguey Parkhomovsky wrote:
> Fixes the following sparse warning for rtw_mlme.c:
>
> drivers/staging/rtl8188eu/core/rtw_mlme.c:810:9: warning: context imbalance in 'rtw_free_assoc_resources' - different lock contexts for basic block
>
> Signed-off-by: Serguey Parkhomovsky <sergueyparkhomovsky@...il.com>
> ---
>   drivers/staging/rtl8188eu/core/rtw_mlme.c | 37 ++++++++++++++++++++-----------
>   1 file changed, 24 insertions(+), 13 deletions(-)

Are these many changes needed just because Sparse is not smart enough to 
understand that the following does not really have a context imbalance:

	if (lock_scanned_queue)
		spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
	.....
	.....

	if (lock_scanned_queue)
   		spin_unlock_bh(&pmlmepriv->scanned_queue.lock);

Nothing in the middle touches lock_scanned_queue, thus if the spin lock and 
unlock operations will be paired. That is all that is important. The fact that 
some tool objects to this construct means that the tool is broken, not the code.

In my mind, Sparse warnings/errors/checks are in place to alert you to a 
possible problem. If they point to white space issues, then you fix them. If 
they point to lines that are too long, then you see if you can shorten them 
without harming the readability. In any case, judgement should be used before 
blindly trying to silence the warning.

For those reasons, NACK.

Larry


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

Powered by blists - more mailing lists