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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 16 Aug 2010 18:27:14 +0200 (CEST)
From:	Julia Lawall <julia@...u.dk>
To:	David Howells <dhowells@...hat.com>, linux-cachefs@...hat.com,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH 9/16] fs/fscache: Remove unnecessary error code assignment

From: Julia Lawall <julia@...u.dk>

In each case, the value of ret is not used.  If an error occurs, -ENOBUFS
is returned explicitly.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@...u.dk>

---
 fs/fscache/page.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index 41c441c..33538ed 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -784,7 +784,6 @@ int __fscache_write_page(struct fscache_cookie *cookie,
 	if (ret < 0)
 		goto nomem_free;
 
-	ret = -ENOBUFS;
 	spin_lock(&cookie->lock);
 
 	if (hlist_empty(&cookie->backing_objects))
@@ -854,7 +853,6 @@ submit_failed:
 	radix_tree_delete(&cookie->stores, page->index);
 	spin_unlock(&cookie->stores_lock);
 	page_cache_release(page);
-	ret = -ENOBUFS;
 	goto nobufs;
 
 nobufs_unlock_obj:
--
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