Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1063a514 authored by Yanjiang Jin's avatar Yanjiang Jin Committed by Bjorn Helgaas
Browse files

PCI/AER: Queue one GHES event, not several uninitialized ones



ecae65e1 ("PCI/AER: Use kfifo_in_spinlocked() to insert locked
elements") replaced kfifo_put() with kfifo_in_spinlocked(), but passed the
*size* of the queue entry, where kfifo_in_spinlocked() expects the *number*
of entries to be copied.

We want to insert only one element into kfifo, not "sizeof(entry) = 16".
Without this patch, we would get 15 uninitialized elements.

Fixes: ecae65e1 ("PCI/AER: Use kfifo_in_spinlocked() to insert locked elements")
Signed-off-by: default avatarYanjiang Jin <yanjiang.jin@hxt-semitech.com>
[bhelgaas: changelog]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarKeith Busch <keith.busch@intel.com>
parent b07b864e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1064,7 +1064,7 @@ void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
		.regs		= aer_regs,
	};

	if (kfifo_in_spinlocked(&aer_recover_ring, &entry, sizeof(entry),
	if (kfifo_in_spinlocked(&aer_recover_ring, &entry, 1,
				 &aer_recover_ring_lock))
		schedule_work(&aer_recover_work);
	else