Use the following script of Conccinelle:
@@
expression E;
expression X;
@@
-if (E != NULL) {
free(E, X); ...
-}
Differential D5904
Remove NULL check before free(9) howard0su_gmail.com on Apr 11 2016, 5:28 AM. Authored by Tags None Referenced Files
Details
Use the following script of Conccinelle: -if (E != NULL) { free(E, X); ... -}
Diff Detail
Event Timeline
Comment Actions I don't think this transformation is correct. It's not valid to lift everything out of the if(){}, only the free() itself. And if there are other statements in the if(){}, I don't believe this improves clarity. Like Allan pointed out, drm2/i915 is mostly contrib code from Linux; I'd prefer to leave that alone to ease porting efforts.
Comment Actions The patch is still refining. I submit this to see if there is strong objection not to do this. (remove null check)
Comment Actions Some of these files, for example firewire and reiserfs, are not built by default. Make sure you compile test them with a suitable kernel config file.
|