drivers/telephony/ixj.c: 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) || …) { } – …

Continue reading

drivers/video/via: 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) || …) { } – …

Continue reading

fs/autofs4: use memdup_user

Author: Julia Lawall <julia@diku.dk> Use memdup_user when user data is immediately copied into the allocated region. Elimination of the variable ads, which is no longer useful. 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 …

Continue reading

drivers/message/i2o/i2o_config.c: 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) || …) { } – …

Continue reading

drivers/mmc/host: 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; …

Continue reading

drivers/char/vt.c: 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) || …) { } – …

Continue reading

sound: Add missing spin_unlock

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: Takashi Iwai — sound/mips/au1x00.c | 1 + sound/oss/dmasound/dmasound_atari.c | 5 +++– 2 files changed, 4 insertions(+), 2 deletions(-) …

Continue reading

Staging: vme: bridges: Add missing unlocks

Author: Julia Lawall <julia@diku.dk> Add a spin_unlock and mutex_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: Martyn Welch Signed-off-by: Greg Kroah-Hartman — drivers/staging/vme/bridges/vme_ca91cx42.c | 4 +++- 1 file changed, 3 insertions(+), 1 …

Continue reading

fs/ocfs2/dlm: Add missing spin_unlock

Author: Julia Lawall <julia@diku.dk> Add a spin_unlock missing on the error path. Unlock as in the other code that leads to the leave label. 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: Joel Becker — fs/ocfs2/dlm/dlmdomain.c | 1 …

Continue reading

fs/xfs/quota: Add missing mutex_unlock

Author: Julia Lawall <julia@diku.dk> Add a mutex_unlock missing on the error path. The use of this lock is balanced elsewhere in the file. 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 Signed-off-by: Alex Elder — fs/xfs/quota/xfs_qm.c | 4 +++- …

Continue reading