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

Commit 38ea4e6e authored by Rickard Strandqvist's avatar Rickard Strandqvist Committed by David S. Miller
Browse files

net: ethernet: ibm: ehea: ehea_qmr.c: Fix for possible null pointer dereference



There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 71fd762f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -103,12 +103,14 @@ static int hw_queue_ctor(struct hw_queue *queue, const u32 nr_of_pages,

static void hw_queue_dtor(struct hw_queue *queue)
{
	int pages_per_kpage = PAGE_SIZE / queue->pagesize;
	int pages_per_kpage;
	int i, nr_pages;

	if (!queue || !queue->queue_pages)
		return;

	pages_per_kpage = PAGE_SIZE / queue->pagesize;

	nr_pages = queue->queue_length / queue->pagesize;

	for (i = 0; i < nr_pages; i += pages_per_kpage)