staging: wlan-ng: ensure error return is actually returned
authorColin Ian King <colin.king@canonical.com>
Tue, 14 Jan 2020 18:16:04 +0000 (18:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jan 2020 12:11:41 +0000 (13:11 +0100)
Currently when the call to prism2sta_ifst fails a netdev_err error
is reported, error return variable result is set to -1 but the
function always returns 0 for success.  Fix this by returning
the error value in variable result rather than 0.

Addresses-Coverity: ("Unused value")
Fixes: 00b3ed168508 ("Staging: add wlan-ng prism2 usb driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200114181604.390235-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2mgmt.c

index 7350fe5d96a341cf8e30fee3de1c7bfb50e74611..a8860d2aee6836a55f28889ea327a0c35bfc78c4 100644 (file)
@@ -959,7 +959,7 @@ int prism2mgmt_flashdl_state(struct wlandevice *wlandev, void *msgp)
                }
        }
 
-       return 0;
+       return result;
 }
 
 /*----------------------------------------------------------------