Commit 1dee43c2 authored by Ziyang Xuan's avatar Ziyang Xuan Committed by David S. Miller
Browse files

octeon_ep: delete unnecessary NULL check



vfree(NULL) is safe. NULL check before vfree() is not needed.
Delete them to simplify the code.

Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e68372ef
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -980,7 +980,6 @@ static void octep_device_cleanup(struct octep_device *oct)
	dev_info(&oct->pdev->dev, "Cleaning up Octeon Device ...\n");

	for (i = 0; i < OCTEP_MAX_VF; i++) {
		if (oct->mbox[i])
		vfree(oct->mbox[i]);
		oct->mbox[i] = NULL;
	}
+1 −2
Original line number Diff line number Diff line
@@ -230,7 +230,6 @@ static int octep_free_oq(struct octep_oq *oq)

	octep_oq_free_ring_buffers(oq);

	if (oq->buff_info)
	vfree(oq->buff_info);

	if (oq->desc_ring)
+1 −2
Original line number Diff line number Diff line
@@ -270,7 +270,6 @@ static void octep_free_iq(struct octep_iq *iq)

	desc_ring_size = OCTEP_IQ_DESC_SIZE * CFG_GET_IQ_NUM_DESC(oct->conf);

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

	if (iq->desc_ring)