[all-commits] [llvm/llvm-project] dcc04e: [Analyzer][MallocChecker] No warning for kfree of ...

Balázs Kéri via All-commits all-commits at lists.llvm.org
Mon Mar 30 01:38:46 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: dcc04e09cf6e36c6d2c47057a8f201f2c0784c69
      https://github.com/llvm/llvm-project/commit/dcc04e09cf6e36c6d2c47057a8f201f2c0784c69
  Author: Balázs Kéri <1.int32 at gmail.com>
  Date:   2020-03-30 (Mon, 30 Mar 2020)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
    M clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp
    M clang/test/Analysis/kmalloc-linux.c
    M clang/test/Analysis/malloc.cpp

  Log Message:
  -----------
  [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR.

Summary:
The kernel kmalloc function may return a constant value ZERO_SIZE_PTR
if a zero-sized block is allocated. This special value is allowed to
be passed to kfree and should produce no warning.

This is a simple version but should be no problem. The macro is always
detected independent of if this is a kernel source code or any other
code.

Reviewers: Szelethus, martong

Reviewed By: Szelethus, martong

Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76830




More information about the All-commits mailing list