Skip to content

Commit

Permalink
netdev-bsd: Fix netdev_bsd_get_mtu() return value.
Browse files Browse the repository at this point in the history
When netdev_bsd_get_mtu() failed, it didn't report the error to the caller,
so the caller couldn't work around not knowing the MTU, and ended up using
an uninitialized 'mtu' value.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Kevin Lo <kevlo@FreeBSD.org>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
  • Loading branch information
blp committed Apr 17, 2015
1 parent c327282 commit a50b2af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/netdev-bsd.c
Expand Up @@ -818,7 +818,7 @@ netdev_bsd_get_mtu(const struct netdev *netdev_, int *mtup)
}
ovs_mutex_unlock(&netdev->mutex);

return 0;
return error;
}

static int
Expand Down

0 comments on commit a50b2af

Please sign in to comment.