This patch fixes potential null pointer access of eth_null_copy_tx().
Reported-by: John Mcnamara <john.mcnamara@intel.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
{
int i;
struct null_queue *h = q;
{
int i;
struct null_queue *h = q;
- unsigned packet_size = h->internals->packet_size;
if ((q == NULL) || (bufs == NULL))
return 0;
if ((q == NULL) || (bufs == NULL))
return 0;
+ packet_size = h->internals->packet_size;
for (i = 0; i < nb_bufs; i++) {
rte_memcpy(h->dummy_packet, rte_pktmbuf_mtod(bufs[i], void *),
packet_size);
for (i = 0; i < nb_bufs; i++) {
rte_memcpy(h->dummy_packet, rte_pktmbuf_mtod(bufs[i], void *),
packet_size);