qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: alevy@redhat.com
Subject: [Qemu-devel] [PATCH 7/7] libcacard/vcard_emul_nss: Drop a redundant conditional
Date: Thu, 22 May 2014 16:57:22 +0200	[thread overview]
Message-ID: <1400770642-18196-8-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1400770642-18196-1-git-send-email-armbru@redhat.com>

Bailing out when PK11_FindGenericObjects() returns null ensures the
loop that follows it executes at least once.  The "loop did not
execute" test right after it is useless.  Drop it.

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 libcacard/vcard_emul_nss.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c
index 83b89e4..2ebe13f 100644
--- a/libcacard/vcard_emul_nss.c
+++ b/libcacard/vcard_emul_nss.c
@@ -618,11 +618,6 @@ vcard_emul_mirror_card(VReader *vreader)
         cert_count++;
     }
 
-    if (cert_count == 0) {
-        PK11_DestroyGenericObjects(firstObj);
-        return NULL;
-    }
-
     /* allocate the arrays */
     vcard_emul_alloc_arrays(&certs, &cert_len, &keys, cert_count);
 
-- 
1.9.0

  parent reply	other threads:[~2014-05-22 14:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 14:57 [Qemu-devel] [PATCH 0/7] libcacard: A few simple fixes and cleanups Markus Armbruster
2014-05-22 14:57 ` [Qemu-devel] [PATCH 1/7] libcacard/vscclient: Bury some dead code Markus Armbruster
2014-05-22 14:57 ` [Qemu-devel] [PATCH 2/7] libcacard: Plug memory leaks around vreader_get_reader_list() Markus Armbruster
2014-05-22 14:57 ` [Qemu-devel] [PATCH 3/7] libcacard/vreader: Drop broken recovery from failed assertion Markus Armbruster
2014-05-22 14:57 ` [Qemu-devel] [PATCH 4/7] libcacard/vreader: Tighten assertion to clarify intent Markus Armbruster
2014-05-22 14:57 ` [Qemu-devel] [PATCH 5/7] libcacard: Convert two leftover realloc() to GLib Markus Armbruster
2014-05-23  9:26   ` Michael Tokarev
2014-05-23  9:44     ` Markus Armbruster
2014-05-22 14:57 ` [Qemu-devel] [PATCH 6/7] libcacard/vcard_emul_nss: Assert vreaderOpt isn't null Markus Armbruster
2014-05-22 14:57 ` Markus Armbruster [this message]
2014-05-22 17:01 ` [Qemu-devel] [PATCH 0/7] libcacard: A few simple fixes and cleanups Alon Levy

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=1400770642-18196-8-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=alevy@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).