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

Commit 9686f310 authored by Markus Elfring's avatar Markus Elfring Committed by David S. Miller
Browse files

net-Liquidio: Delete unnecessary checks before the function call "vfree"



The vfree() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a6947174
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -650,13 +650,11 @@ void octeon_free_device_mem(struct octeon_device *oct)

	for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES; i++) {
		/* could check  mask as well */
		if (oct->droq[i])
		vfree(oct->droq[i]);
	}

	for (i = 0; i < MAX_OCTEON_INSTR_QUEUES; i++) {
		/* could check mask as well */
		if (oct->instr_queue[i])
		vfree(oct->instr_queue[i]);
	}

@@ -1078,10 +1076,7 @@ octeon_unregister_dispatch_fn(struct octeon_device *oct, u16 opcode,
		oct->dispatch.count--;

	spin_unlock_bh(&oct->dispatch.lock);

	if (dfree)
	vfree(dfree);

	return retval;
}

+1 −3
Original line number Diff line number Diff line
@@ -216,8 +216,6 @@ int octeon_delete_droq(struct octeon_device *oct, u32 q_no)
	dev_dbg(&oct->pci_dev->dev, "%s[%d]\n", __func__, q_no);

	octeon_droq_destroy_ring_buffers(oct, droq);

	if (droq->recv_buf_list)
	vfree(droq->recv_buf_list);

	if (droq->info_base_addr)
+1 −2
Original line number Diff line number Diff line
@@ -175,7 +175,6 @@ int octeon_delete_instr_queue(struct octeon_device *oct, u32 iq_no)
		desc_size =
		    CFG_GET_IQ_INSTR_TYPE(CHIP_FIELD(oct, cn6xxx, conf));

	if (iq->request_list)
	vfree(iq->request_list);

	if (iq->base_addr) {