All of lore.kernel.org
 help / color / mirror / Atom feed
From: <pannengyuan@huawei.com>
To: <david@gibson.dropbear.id.au>
Cc: kuhn.chenqun@huawei.com, qemu-arm@nongnu.org,
	PanNengyuan <pannengyuan@huawei.com>,
	qemu-devel@nongnu.org, kenny.zhangjun@huawei.com
Subject: [PATCH V2] ppc/spapr_events: fix potential NULL pointer dereference in rtas_event_log_dequeue
Date: Mon, 25 Nov 2019 20:34:51 +0800	[thread overview]
Message-ID: <1574685291-38176-1-git-send-email-pannengyuan@huawei.com> (raw)

From: PanNengyuan <pannengyuan@huawei.com>

This fixes coverity issues 68911917:
        360
    CID 68911917: (NULL_RETURNS)
        361. dereference: Dereferencing "source", which is known to be
             "NULL".
        361        if (source->mask & event_mask) {
        362            break;
        363        }

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: PanNengyuan <pannengyuan@huawei.com>
---
 hw/ppc/spapr_events.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 0e4c195..e355e00 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -358,6 +358,7 @@ static SpaprEventLogEntry *rtas_event_log_dequeue(SpaprMachineState *spapr,
             rtas_event_log_to_source(spapr,
                                      spapr_event_log_entry_type(entry));
 
+        g_assert(source);
         if (source->mask & event_mask) {
             break;
         }
-- 
2.7.2.windows.1




             reply	other threads:[~2019-11-25 12:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 12:34 pannengyuan [this message]
2019-11-25 23:13 ` [PATCH V2] ppc/spapr_events: fix potential NULL pointer dereference in rtas_event_log_dequeue David Gibson

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=1574685291-38176-1-git-send-email-pannengyuan@huawei.com \
    --to=pannengyuan@huawei.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=kenny.zhangjun@huawei.com \
    --cc=kuhn.chenqun@huawei.com \
    --cc=qemu-arm@nongnu.org \
    --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 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.