int
dpif_open(const char *name, struct dpif *dpif)
{
- unsigned int minor;
int listen_mask;
int error;
dpif->fd = -1;
- error = name_to_minor(name, &minor);
+ error = name_to_minor(name, &dpif->minor);
if (error) {
return error;
}
- error = open_by_minor(minor, dpif);
+ error = open_by_minor(dpif->minor, dpif);
if (error) {
return error;
}
/* We can open the device, but that doesn't mean that it's been created.
* If it hasn't been, then any command other than ODP_DP_CREATE will
* return ENODEV. Try something innocuous. */
+ listen_mask = 0; /* Make Valgrind happy. */
if (ioctl(dpif->fd, ODP_GET_LISTEN_MASK, &listen_mask)) {
error = errno;
if (error != ENODEV) {
VLOG_WARN("dp%u: probe returned unexpected error: %s",
- minor, strerror(error));
+ dpif->minor, strerror(error));
}
dpif_close(dpif);
return error;