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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1360877784-12144-1-git-send-email-peterhuewe@gmx.de>
Date:	Thu, 14 Feb 2013 22:36:24 +0100
From:	Peter Huewe <peterhuewe@....de>
To:	Ian Abbott <abbotti@....co.uk>
Cc:	Mori Hess <fmhess@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	H Hartley Sweeten <hsweeten@...ionengravers.com>,
	Bill Pemberton <wfp5p@...ginia.edu>,
	Peter Huewe <peterhuewe@....de>, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] staging/comedi: Fix if(); by adding proper code

Smatch warns about:
staging/comedi/drivers/cb_pcidas64.c:3304 prep_ao_dma() warn: if();

So the check currently does nothing and could be removed, but the better
alternative is to activate the check again and return -1; if it
evaluates to true.

Signed-off-by: Peter Huewe <peterhuewe@....de>
---
 drivers/staging/comedi/drivers/cb_pcidas64.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index d33fc32..782498f 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -3301,7 +3301,8 @@ static int prep_ao_dma(struct comedi_device *dev, const struct comedi_cmd *cmd)
 	num_bytes = load_ao_dma_buffer(dev, cmd);
 	if (num_bytes == 0)
 		return -1;
-	if (num_bytes >= DMA_BUFFER_SIZE) ;
+	if (num_bytes >= DMA_BUFFER_SIZE)
+		return -1;
 	load_ao_dma(dev, cmd);
 
 	dma_start_sync(dev, 0);
-- 
1.7.8.6

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ