mirror of
https://github.com/OpenAMP/open-amp.git
synced 2026-09-25 19:14:02 +08:00
virtio: fix NULL pointer dereference in virtqueue_notification
Add a NULL check for vq before dereferencing it in virtqueue_notification() to prevent a crash when vq is NULL. Signed-off-by: Shichun Ma <masc2008@gmail.com>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
23d4c5d7a5
commit
9ff23a10ce
@@ -620,7 +620,7 @@ static int vq_ring_enable_interrupt(struct virtqueue *vq, uint16_t ndesc)
|
||||
void virtqueue_notification(struct virtqueue *vq)
|
||||
{
|
||||
atomic_thread_fence(memory_order_seq_cst);
|
||||
if (vq->callback)
|
||||
if (vq && vq->callback)
|
||||
vq->callback(vq);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user