staging: vt6656: don't return zero on failure path in vt6656_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 13 Mar 2015 22:34:41 +0000 (01:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2015 12:41:38 +0000 (13:41 +0100)
If ieee80211_alloc_hw() fails in vt6656_probe(), it breaks off
initialization, but returns zero.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/main_usb.c

index 71adc1f61838654c0abb10bd377057de19a18a43..ab3ab84cb0a717179472971d2817724441cbb350 100644 (file)
@@ -963,6 +963,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
        hw = ieee80211_alloc_hw(sizeof(struct vnt_private), &vnt_mac_ops);
        if (!hw) {
                dev_err(&udev->dev, "could not register ieee80211_hw\n");
+               rc = -ENOMEM;
                goto err_nomem;
        }