On Thu, 6 Dec 2018, Johannes Thumshirn wrote:
> On 05/12/2018 15:46, Julia Lawall wrote:
> [...]
> >> +@r_patch depends on !context && patch && !org && !report@
> >> +expression E;
> >> +type T;
> >> +@@
> >> +
This unfortunately doesn't account for the case when we want PAGE_ALIGNED()
> instead of offset_in_page() yet.
>
> Cc: Julia Lawall
> Signed-off-by: Johannes Thumshirn
> ---
> scripts/coccinelle/api/offset_in_page.cocci | 81
> +
> 1 file chang
It does not look correct to access >node on line 322 after freeing be
on line 321.
julia
-- Forwarded message --
Date: Fri, 1 Sep 2017 07:41:26 +0800
From: kbuild test robot <fengguang...@intel.com>
To: kbu...@01.org
Cc: Julia Lawall <julia.law...@lip6.fr>
It looks like the tree_log_mutex needs to be unlocked at lines 2153 and
2159.
julia
-- Forwarded message --
Date: Tue, 29 Nov 2016 14:16:30 +0800
From: kbuild test robot <fengguang...@intel.com>
To: kbu...@01.org
Cc: Julia Lawall <julia.law...@lip6.fr>
Subject: Re
Recent commits to kernel/git/torvalds/linux.git have made the following
functions able to tolerate NULL arguments:
kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)
These patches remove the associated NULL tests for the files
Remove unneeded NULL test.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
//
@@ expression x; @@
-if (x != NULL)
\(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
//
Signed-off-by: Julia Lawall <julia.law...@lip6.fr>
---
fs
This does not look correct. Please check.
julia
On Thu, 11 Jun 2015, kbuild test robot wrote:
TO: Liu Bo bo.li@oracle.com
CC: Chris Mason chris.ma...@fusionio.com Chris Mason c...@fb.com
CC: David Sterba dste...@suse.cz
CC: linux-btrfs@vger.kernel.org
tree:
On Wed, 11 Feb 2015, Bas Peters wrote:
kfree checks whether the pointer it is passed is NULL. The two foregoing
checks are therefore unnecessary.
This issue was detected using Coccinelle.
Signed-off-by: Bas Peters baspeter...@gmail.com
---
fs/btrfs/free-space-cache.c | 6 ++
1
On Fri, 31 Oct 2014, SF Markus Elfring wrote:
The following functions test whether their argument is NULL and then
return immediately.
* btrfs_free_path()
* free_extent_buffer()
* free_extent_map()
* free_extent_state()
* iput()
* kfree()
Thus the test around the call is not needed.
It looks like these patches were not a good idea, because in each case the
printk provides an error level, and WARN then provides another one.
Sorry for the noise.
julia
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to
From: Julia Lawall julia.law...@lip6.fr
Use WARN rather than printk followed by WARN_ON(1), for conciseness.
A simplified version of the semantic patch that makes this transformation
is as follows: (http://coccinelle.lip6.fr/)
// smpl
@@
expression list es;
@@
-printk(
+WARN(1,
es);
-WARN_ON
From: Julia Lawall julia.law...@lip6.fr
Just use WARN_ON rather than an if containing only WARN_ON(1).
A simplified version of the semantic patch that makes this transformation
is as follows: (http://coccinelle.lip6.fr/)
// smpl
@@
expression e;
@@
- if (e) WARN_ON(1);
+ WARN_ON(e);
// /smpl
From: Julia Lawall julia.law...@lip6.fr
Free fs_devices as done in the error-handling code just below.
Signed-off-by: Julia Lawall julia.law...@lip6.fr
---
fs/btrfs/volumes.c |4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index
From: Julia Lawall ju...@diku.dk
Use BUG_ON(x) rather than if(x) BUG();
The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@ identifier x; @@
-if (x) BUG();
+BUG_ON(x);
@@ identifier x; @@
-if (!x) BUG();
+BUG_ON(!x);
// /smpl
Signed-off-by: Julia
Hi all,
I'm really sorry to have spammed your mailbox with my send-email
experiments...
julia
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Julia Lawall ju...@diku.dk
Error codes are stored in ret, but the return value is always 0. Return
ret instead.
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
From: Julia Lawall ju...@diku.dk
Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)). The former makes more
clear what is the purpose of the operation, which otherwise looks like a
no-op.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@@
type T;
T x
From: Julia Lawall ju...@diku.dk
If the kfree is executed, the dereference of range afterwards will
represent a use after free. Added goto out, as done in the other nearby
error handling code.
A simplified version of the semantic match that finds this problem is as
follows: (http
From: Julia Lawall ju...@diku.dk
Error handling code following a kzalloc should free the allocated data.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// smpl
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l
From: Julia Lawall ju...@diku.dk
If spin_lock_irqsave is called twice in a row with the same second
argument, the interrupt state at the point of the second call overwrites
the value saved by the first call. Indeed, the second call does not need
to save the interrupt state, so it is changed
From: Julia Lawall ju...@diku.dk
Move the call to BUG_ON to before the dereference of the tested value.
A simplified version of the semantic match that finds this problem is as
follows: (http://www.emn.fr/x-info/coccinelle/)
// smpl
@r@
expression x,E,E1;
identifier f,l;
position p1,p2
21 matches
Mail list logo