drivers: ethernet: eth_virtio_net: remove invalid NULL check
Remove a NULL check on the device pointer that occurs after the pointer has already been dereferenced. This check can never be true and is therefore misleading. Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
This commit is contained in:
committed by
Henrik Brix Andersen
parent
a2f45762f1
commit
0f59ae35d4
@@ -188,10 +188,6 @@ static void virtnet_if_init(struct net_if *iface)
|
||||
struct virtnet_data *data = dev->data;
|
||||
const struct virtnet_config *config = dev->config;
|
||||
|
||||
if (dev == NULL) {
|
||||
LOG_ERR("could not access device structure!");
|
||||
return;
|
||||
}
|
||||
data->iface = iface;
|
||||
net_if_set_link_addr(iface, data->mac, sizeof(data->virtio_devcfg->mac), NET_LINK_ETHERNET);
|
||||
struct virtq *vq = virtio_get_virtqueue(config->vdev, VIRTQ_RX(1));
|
||||
|
||||
Reference in New Issue
Block a user