KVM: ia64: Add missing spin_unlock in kvm_arch_hardware_enable()

Author: Julia Lawall <julia@diku.dk> Add a spin_unlock missing on the error path. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E1; @@ * spin_lock(E1,…); * spin_unlock(E1,…); // Signed-off-by: Julia Lawall Signed-off-by: Avi Kivity — arch/ia64/kvm/kvm-ia64.c | 1 + 1 file changed, 1 insertion(+)   diff –git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index …

Lire la suite

fs: Add missing mutex_unlock

Author: Julia Lawall <julia@diku.dk> Add a mutex_unlock missing on the error path. At other exists from the function that return an error flag, the mutex is unlocked, so do the same here. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E1; @@ * mutex_lock(E1,…); * mutex_unlock(E1,…); // Signed-off-by: Julia …

Lire la suite

net/iucv: Add missing spin_unlock

Author: Julia Lawall <julia@diku.dk> Add a spin_unlock missing on the error path. There seems like no reason why the lock should continue to be held if the kzalloc fail. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E1; @@ * spin_lock(E1,…); * spin_unlock(E1,…); // Signed-off-by: Julia Lawall Signed-off-by: David …

Lire la suite

drivers/isdn/hardware/mISDN: Add missing spin_unlock

Author: Julia Lawall <julia@diku.dk> Add a spin_unlock missing on the error path. The return value of write_reg seems to be completely ignored, so it seems that the lock should be released in every case. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E1; @@ * spin_lock(E1,…); * spin_unlock(E1,…); // …

Lire la suite

net/rds: Add missing mutex_unlock

Author: Julia Lawall <julia@diku.dk> Add a mutex_unlock missing on the error path. In each case, whenever the label out is reached from elsewhere in the function, mutex is not locked. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E1; @@ * mutex_lock(E1); * mutex_unlock(E1); // Signed-off-by: Julia Lawall Reviewed-by: …

Lire la suite

crypto: Use ERR_CAST

Author: Julia Lawall <julia@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/) // @@ type T; T x; identifier f; @@ T f (…) { } @@ expression x; …

Lire la suite

arch/x86/pci: use kasprintf

Author: Julia Lawall <julia@diku.dk> kasprintf combines kmalloc and sprintf, and takes care of the size calculation itself. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression a,flag; expression list args; statement S; @@ a = – \(kmalloc\|kzalloc\)(…,flag) + kasprintf(flag,args) – sprintf(a,args); // Signed-off-by: Julia Lawall LKML-Reference: Signed-off-by: Andrew Morton Signed-off-by: …

Lire la suite

fs/ceph: Use ERR_CAST

Author: Julia Lawall <julia@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. In the case of fs/ceph/inode.c, ERR_CAST is not needed, because the type of the returned value is the same as the type of the enclosing function. The semantic …

Lire la suite

Staging: dream: camera: Use memdup_user

Author: Julia Lawall <julia@diku.dk> Use memdup_user when user data is immediately copied into the allocated region. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression from,to,size,flag; position p; identifier l1,l2; @@ – to = \(kmalloc@p\|kzalloc@p\)(size,flag); + to = memdup_user(from,size); if ( – to==NULL + IS_ERR(to) || …) { } – …

Lire la suite

USB: gadget: Use memdup_user

Author: Julia Lawall <julia@diku.dk> Use memdup_user when user data is immediately copied into the allocated region. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression from,to,size,flag; position p; identifier l1,l2; @@ – to = \(kmalloc@p\|kzalloc@p\)(size,flag); + to = memdup_user(from,size); if ( – to==NULL + IS_ERR(to) || …) { } – …

Lire la suite