netdev-bsd: Fix netdev_bsd_get_mtu() return value.
authorBen Pfaff <blp@nicira.com>
Thu, 16 Apr 2015 21:19:37 +0000 (14:19 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 17 Apr 2015 16:34:29 +0000 (09:34 -0700)
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>
lib/netdev-bsd.c

index 671de37..b377baf 100644 (file)
@@ -834,7 +834,7 @@ netdev_bsd_get_mtu(const struct netdev *netdev_, int *mtup)
     }
     ovs_mutex_unlock(&netdev->mutex);
 
-    return 0;
+    return error;
 }
 
 static int