[apparmor] [PATCH 00/61] treewide: Use IS_ERR_OR_NULL over manual NULL check - refactor

Steven Rostedt rostedt at goodmis.org
Tue Mar 10 14:14:42 UTC 2026


On Tue, 10 Mar 2026 12:48:26 +0100
Philipp Hahn <phahn-oss at avm.de> wrote:

> While doing some static code analysis I stumbled over a common pattern,
> where IS_ERR() is combined with a NULL check. For that there is
> IS_ERR_OR_NULL().
> 
> I've written a Coccinelle patch to find and patch those instances.
> The patches follow grouped by subsystem.


Honestly, the IS_ERR_OR_NULL() looks worse in a lot of the locations you
updated. Just because we have IS_ERR_OR_NULL() doesn't mean we need to go
and replace every location that can use it.

NAK for any code this touches that I'm responsible for.

-- Steve



More information about the AppArmor mailing list