]> git.ipfire.org Git - people/jschlag/network.git/commitdiff
network-phy-list-ht-caps: Fix SEGV when no PHY was found
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Feb 2018 11:46:56 +0000 (11:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Feb 2018 11:46:56 +0000 (11:46 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/utils/network-phy-list-ht-caps.c

index 0b8787243a5be8f1a9e71f46e06581bf22e15823..3a6538bce56702b4554bbe56b9b5a49f2f7e37c9 100644 (file)
@@ -27,6 +27,7 @@
 
 int main(int argc, char** argv) {
     struct network_ctx* ctx = NULL;
+    struct network_phy* phy = NULL;
     int r;
 
     if (argc < 2) {
@@ -40,7 +41,6 @@ int main(int argc, char** argv) {
     if (r)
         return r;
 
-    struct network_phy* phy;
     r = network_phy_new(ctx, &phy, argv[1]);
     if (r) {
         fprintf(stderr, "Could not find %s\n", argv[1]);