qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: mjt@tls.msk.ru, alevy@redhat.com
Subject: [Qemu-devel] [PATCH v2 7/7] libcacard/vcard_emul_nss: Drop a redundant conditional
Date: Fri, 23 May 2014 13:24:39 +0200	[thread overview]
Message-ID: <1400844279-1685-8-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1400844279-1685-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>
Reviewed-by: Alon Levy <alevy@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 4f55e44..8f8e9e0 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-23 11:25 UTC|newest]

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

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=1400844279-1685-8-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=alevy@redhat.com \
    --cc=mjt@tls.msk.ru \
    --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).