Adjust tests to compare against NULL, to match cases that explicitly make that comparison. Remove removal and re-addition of freeing functions. Add position variable on usb_free_urb in the non-patch case.
Unified · Split
| @@ -16,19 +16,15 @@ virtual context · 15 unmodified lines | ||
| 16 | 16 | @r2 depends on patch@ |
| 17 | 17 | expression E; |
| 18 | 18 | @@ |
| 19 | −- if (E) | |
| 19 | +- if (E != NULL) | |
| 20 | 20 | ( |
| 21 | −- kfree(E); | |
| 22 | −+ kfree(E); | |
| 21 | + kfree(E); | |
| 23 | 22 | | |
| 24 | −- debugfs_remove(E); | |
| 25 | −+ debugfs_remove(E); | |
| 23 | + debugfs_remove(E); | |
| 26 | 24 | | |
| 27 | −- debugfs_remove_recursive(E); | |
| 28 | −+ debugfs_remove_recursive(E); | |
| 25 | + debugfs_remove_recursive(E); | |
| 29 | 26 | | |
| 30 | −- usb_free_urb(E); | |
| 31 | −+ usb_free_urb(E); | |
| 27 | + usb_free_urb(E); | |
| 32 | 28 | ) |
| 33 | 29 | |
| 34 | 30 | @r depends on context || report || org @ |
| @@ -36,8 +32,8 @@ expression E; · 1 unmodified line | ||
| 36 | 32 | position p; |
| 37 | 33 | @@ |
| 38 | 34 | |
| 39 | −* if (E) | |
| 40 | −* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E); | |
| 35 | +* if (E != NULL) | |
| 36 | +* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\)(E); | |
| 41 | 37 | |
| 42 | 38 | @script:python depends on org@ |
| 43 | 39 | p << r.p; |