vfree(NULL) is safe. NULL check before vfree() is not needed.
Delete them to simplify the code.
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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]);
+ vfree(oct->mbox[i]);
oct->mbox[i] = NULL;
}
octep_oq_free_ring_buffers(oq);
- if (oq->buff_info)
- vfree(oq->buff_info);
+ vfree(oq->buff_info);
if (oq->desc_ring)
dma_free_coherent(oq->dev,
desc_ring_size = OCTEP_IQ_DESC_SIZE * CFG_GET_IQ_NUM_DESC(oct->conf);
- if (iq->buff_info)
- vfree(iq->buff_info);
+ vfree(iq->buff_info);
if (iq->desc_ring)
dma_free_coherent(iq->dev, desc_ring_size,