Catégorie : Linux

IB/ipath: Use unsigned long for irq flags

Author: Vegard Nossum <vegard.nossum@gmail.com> A few functions in the ipath driver incorrectly use unsigned int to hold irq flags for spin_lock_irqsave(). This patch was generated using the Coccinelle framework with the following semantic patch: The semantic patch I used was this: @@ expression lock; identifier flags; expression subclass; @@ – unsigned int flags; + unsigned …

Lire la suite

drivers/video: release mutex in error handling code

Author: Julia Lawall <julia@diku.dk> The mutex is released on a successful return, so it would seem that it should be released on an error return as well. The semantic patch finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression l; @@ mutex_lock(l); … when != mutex_unlock(l) when any when strict ( if (…) { …

Lire la suite

PS3: gelic: use unsigned long for irqflags

Author: Vegard Nossum <vegard.nossum@gmail.com> The semantic patch I used was this: @@ expression lock; identifier flags; expression subclass; @@ – unsigned int flags; + unsigned long flags; … This patch was generated using the Coccinelle framework. Cc: Masakazu Mokuno Cc: Julia Lawall Cc: Alexey Dobriyan Signed-off-by: Vegard Nossum Signed-off-by: John W. Linville — drivers/net/ps3_gelic_wireless.c | …

Lire la suite

[CPUFREQ] drivers/cpufreq/cpufreq.c: Adjust error handling code involving cpufreq_cpu_put

Author: Julia Lawall <julia@diku.dk> After calling cpufreq_cpu_get, error handling code should call cpufreq_cpu_put. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r@ expression x,E; statement S; position p1,p2,p3; @@ ( if ((x = cpufreq_cpu_get@p1(…)) == NULL || …) S | x = cpufreq_cpu_get@p1(…) … when != x if (x == NULL …

Lire la suite

fs/nfsd/export.c: Adjust error handling code involving auth_domain_put

Author: Julia Lawall <julia@diku.dk> Once clp is assigned, it never becomes NULL, so we can make a label for it in the error handling code. Because the call to path_lookup follows the call to auth_domain_find, its error handling code should jump to this new label. The semantic match that finds this problem is as follows: …

Lire la suite

IB/ehca: Release mutex in error path of alloc_small_queue_page()

Author: Julia Lawall <julia@diku.dk> The pd->lock mutex is released on a successful return, so it should be released on an error return as well. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression l; @@ mutex_lock(l); … when != mutex_unlock(l) when any when strict ( if (…) { … when …

Lire la suite

KVM: ia64: Fix irq disabling leak in error handling code

Author: Julia Lawall <julia@diku.dk> There is a call to local_irq_restore in the normal exit case, so it would seem that there should be one on an error return as well. The semantic patch that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression l; expression E,E1,E2; @@ local_irq_save(l); … when != local_irq_restore(l) when != …

Lire la suite

b43legacy: Release mutex in error handling code

Author: Julia Lawall <julia@diku.dk> The mutex is released on a successful return, so it would seem that it should be released on an error return as well. The semantic patch finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression l; @@ mutex_lock(l); … when != mutex_unlock(l) when any when strict ( if (…) { …

Lire la suite

[PATCH] ocfs2: Release mutex in error handling code

Author: Julia Lawall <julia@diku.dk> The mutex is released on a successful return, so it would seem that it should be released on an error return as well. The semantic patch finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression l; @@ mutex_lock(l); … when != mutex_unlock(l) when any when strict ( if (…) { …

Lire la suite

[SCSI] scsi_scan.c: Release mutex in error handling code

Author: Julia Lawall <julia@diku.dk> The mutex is released on a successful return, so it would seem that it should be released on an error return as well. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression l; @@ mutex_lock(l); … when != mutex_unlock(l) when any when strict ( if (…) …

Lire la suite