All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 00/30] Fixes from clang
Date: Mon, 25 Oct 2010 10:24:07 +0200	[thread overview]
Message-ID: <cover.1287994529.git.zkabelac@redhat.com> (raw)

Patchset combines code cleanups for compiler warnings
and code fixes found by static analyzer scan-build.

Potentional NULL pointer dereferencies are mostly
in very unusual code execution paths. I've tried to
order them on their importance - the later ones are not
event trigerable as surrounding code should not be to
pass problematic values - but checks seems to be simple
enough to keep static analysis happy.

Last patches in this set add some instrumentation to
function calls that might allow better code optimization
or better static analysis.

Zdenek Kabelac (30):
  Fix clang warning for ntohl(*((uint32_t *)buf))
  Use dm_pool_grow_object embeded strlen for 0 delta
  Check (type) is not NULL before access
  Fix NULL pointer dereference
  Print vg_name and do not to access vg->name
  Ensure we always have origin defined
  Ensure seg is nonnull
  Ensure  first is not NULL
  Reuse result of previous strchr.
  Fix potential NULL pointer dereference
  Fix theoretical usage of NULL pointer dereference
  Check for NULL pointer
  Eliminate uninitialized_var
  Fix missing initilisation to 0
  Function pull_state cannot work with NULL buffer
  Fix  void* pointer arithmetic
  Use const pvid for device_from_pvid()
  Use const pointer for return value of dm_basename
  Fix constness warning
  Fix constness warning
  Fix constness warning
  Fix constness warning
  Using const config node
  bufused is assigned 0 in preceding source line
  Proper C declaration
  Use static
  Instrument compiler about code unreachability
  Skip uninitialized macro for scan-build
  Add some __attribute__ instrumentation
  __attribute__((nonnull(1)))

 daemons/clvmd/clvmd.c                 |    7 +++++--
 daemons/cmirrord/cluster.c            |    2 +-
 daemons/cmirrord/functions.c          |    4 +++-
 daemons/dmeventd/dmeventd.c           |   21 +++++++++++----------
 daemons/dmeventd/libdevmapper-event.c |   20 ++++++++++----------
 lib/activate/dev_manager.c            |    2 +-
 lib/cache/lvmcache.c                  |   10 +++++-----
 lib/cache/lvmcache.h                  |    2 +-
 lib/config/config.c                   |    2 +-
 lib/device/dev-cache.h                |    2 +-
 lib/device/dev-md.c                   |    3 ++-
 lib/format1/format1.c                 |    2 +-
 lib/format_text/archive.c             |    4 ++--
 lib/format_text/format-text.c         |    2 +-
 lib/log/log.c                         |    2 +-
 lib/metadata/lv_manip.c               |    2 +-
 lib/metadata/metadata.c               |    6 +++---
 lib/misc/crc.c                        |    6 +++---
 lib/misc/util.h                       |    4 ++++
 lib/mm/memlock.c                      |    4 ++--
 lib/report/report.c                   |    6 +++---
 lib/striped/striped.c                 |    2 +-
 libdm/libdevmapper.h                  |   28 ++++++++++++++--------------
 libdm/libdm-report.c                  |    7 ++++---
 libdm/libdm-string.c                  |    6 +++---
 libdm/mm/pool-fast.c                  |    8 ++++----
 libdm/regex/ttree.c                   |    7 +++++--
 tools/dmsetup.c                       |    2 +-
 tools/lvcreate.c                      |    4 ++++
 tools/lvm.c                           |    6 +++---
 tools/lvmcmdline.c                    |    2 +-
 tools/pvresize.c                      |    2 +-
 tools/reporter.c                      |    2 +-
 tools/toollib.c                       |    2 +-
 34 files changed, 105 insertions(+), 86 deletions(-)

--
1.7.3.1



             reply	other threads:[~2010-10-25  8:24 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25  8:24 Zdenek Kabelac [this message]
2010-10-25  8:24 ` [PATCH 01/30] Fix clang warning for ntohl(*((uint32_t *)buf)) Zdenek Kabelac
2010-10-25  9:46   ` ejt
2010-10-25  8:24 ` [PATCH 02/30] Use dm_pool_grow_object embeded strlen for 0 delta Zdenek Kabelac
2010-10-25  9:56   ` ejt
2010-10-25 10:59     ` Zdenek Kabelac
2010-10-26  0:13       ` Alasdair G Kergon
2010-10-25  8:24 ` [PATCH 03/30] Check (type) is not NULL before access Zdenek Kabelac
2010-10-25  9:58   ` ejt
2010-10-25  8:24 ` [PATCH 04/30] Fix NULL pointer dereference Zdenek Kabelac
2010-10-25  9:49   ` ejt
2010-10-25  8:24 ` [PATCH 05/30] Print vg_name and do not to access vg->name Zdenek Kabelac
2010-10-25  9:59   ` ejt
2010-10-25  8:24 ` [PATCH 06/30] Ensure we always have origin defined Zdenek Kabelac
2010-10-25 10:04   ` ejt
2010-10-25  8:24 ` [PATCH 07/30] Ensure seg is nonnull Zdenek Kabelac
2010-10-25 10:02   ` ejt
2010-10-25  8:24 ` [PATCH 08/30] Ensure first is not NULL Zdenek Kabelac
2010-10-25 10:07   ` ejt
2010-10-25  8:24 ` [PATCH 09/30] Reuse result of previous strchr Zdenek Kabelac
2010-10-25 10:03   ` ejt
2010-10-25  8:24 ` [PATCH 10/30] Fix potential NULL pointer dereference Zdenek Kabelac
2010-10-25 10:08   ` ejt
2010-10-25  8:24 ` [PATCH 11/30] Fix theoretical usage of " Zdenek Kabelac
2010-10-25 10:24   ` ejt
2010-10-25  8:24 ` [PATCH 12/30] Check for NULL pointer Zdenek Kabelac
2010-10-25  8:24 ` [PATCH 13/30] Eliminate uninitialized_var Zdenek Kabelac
2010-10-25 10:18   ` ejt
2010-10-25 11:13     ` Zdenek Kabelac
2010-10-25 11:21       ` ejt
2010-10-25  8:24 ` [PATCH 14/30] Fix missing initilisation to 0 Zdenek Kabelac
2010-10-25 10:18   ` ejt
2010-10-25  8:24 ` [PATCH 15/30] Function pull_state cannot work with NULL buffer Zdenek Kabelac
2010-10-25 10:18   ` ejt
2010-10-25  8:24 ` [PATCH 16/30] Fix void* pointer arithmetic Zdenek Kabelac
2010-10-25 10:20   ` ejt
2010-10-25 11:17     ` Zdenek Kabelac
2010-10-25 11:23       ` ejt
2010-10-25 11:23   ` Milan Broz
2010-10-25 11:33     ` Zdenek Kabelac
2010-10-25  8:24 ` [PATCH 17/30] Use const pvid for device_from_pvid() Zdenek Kabelac
2010-10-25 10:25   ` ejt
2010-10-25  8:24 ` [PATCH 18/30] Use const pointer for return value of dm_basename Zdenek Kabelac
2010-10-25 10:37   ` ejt
2010-10-25  8:24 ` [PATCH 19/30] Fix constness warning Zdenek Kabelac
2010-10-25 10:30   ` ejt
2010-10-25  8:24 ` [PATCH 20/30] " Zdenek Kabelac
2010-10-25 10:28   ` ejt
2010-10-25  8:24 ` [PATCH 21/30] " Zdenek Kabelac
2010-10-25 10:33   ` ejt
2010-10-25  8:24 ` [PATCH 22/30] " Zdenek Kabelac
2010-10-25 10:34   ` ejt
2010-10-25  8:24 ` [PATCH 23/30] Using const config node Zdenek Kabelac
2010-10-25 10:37   ` ejt
2010-10-25  8:24 ` [PATCH 24/30] bufused is assigned 0 in preceding source line Zdenek Kabelac
2010-10-25 10:35   ` ejt
2010-10-25  8:24 ` [PATCH 25/30] Proper C declaration Zdenek Kabelac
2010-10-25 10:42   ` ejt
2010-10-25  8:24 ` [PATCH 26/30] Use static Zdenek Kabelac
2010-10-25 10:38   ` ejt
2010-10-25  8:24 ` [PATCH 27/30] Instrument compiler about code unreachability Zdenek Kabelac
2010-10-25 10:41   ` ejt
2010-10-25  8:24 ` [PATCH 28/30] Skip uninitialized macro for scan-build Zdenek Kabelac
2010-10-25 10:40   ` ejt
2010-10-25  8:24 ` [PATCH 29/30] Add some __attribute__ instrumentation Zdenek Kabelac
2010-10-25 10:44   ` ejt
2010-10-25 11:40     ` Zdenek Kabelac
2010-10-25  8:24 ` [PATCH 30/30] __attribute__((nonnull(1))) Zdenek Kabelac
2010-10-25 10:45   ` ejt
2010-10-25  9:12 ` [PATCH 00/30] Fixes from clang Jim Meyering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1287994529.git.zkabelac@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.