Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2019 21:28:35 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 240545] patch to remove unneeded M_WAITOK return value checks
Message-ID:  <bug-240545-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D240545

            Bug ID: 240545
           Summary: patch to remove unneeded M_WAITOK return value checks
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: arr@watson.org

Created attachment 207432
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D207432&action=
=3Dedit
remove NULL check and handling of it for M_WAITOK cases

Attached is a patch that removes the check of malloc(9)'s return value agai=
nst
NULL when M_WAITOK flag is used. This does not cover all cases, but a numbe=
r of
them that I found with an LLVM pass and partial compilation of kernel. That
pass also checks mallocarray(), realloc(), and reallocf(), but in the areas
analyzed did not see the extra code. I am not sure I like the idea of remov=
ing
NULL checks, but it is already handled. Are there any cases to be aware of =
for
why the check would be necessary with M_WAITOK? If no, I will try to go thr=
ough
and look for others. The patch is for 12.0-RELEASE, but can adjust that as
well.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-240545-227>