[PATCH] D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR.

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 27 05:24:15 PDT 2020


Szelethus added inline comments.


================
Comment at: clang/test/Analysis/kmalloc-linux-1.c:15
+
+// FIXME: malloc checker expects kfree with 2 arguments, is this correct?
+// (recent kernel source code contains a `kfree(const void *)`)
----------------
balazske wrote:
> Szelethus wrote:
> > balazske wrote:
> > > Szelethus wrote:
> > > > martong wrote:
> > > > > Do you plan to sniff around a bit about the arguments (as part of another patch)? Would be good to handle both old and new signature kernel allocation functions.
> > > > I'll take a quick look as well, I am quite familiar with MallocChecker.
> > > I found that `kfree` has one argument, not two (even in the 2.6 kernel). Probably argument count was wrong in the last change when `CallDescription` was introduced.
> > Yup, you're totally right, this was on me :) I'll get that fixed.
> Is it better to add these tests to **kmalloc-linux.c**?
I think so, yea.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76830/new/

https://reviews.llvm.org/D76830





More information about the cfe-commits mailing list