]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xen-netback: fix error handling output
authorArnd Bergmann <arnd@arndb.de>
Thu, 10 Nov 2016 08:55:42 +0000 (09:55 +0100)
committerJuergen Gross <jgross@suse.com>
Thu, 10 Nov 2016 08:55:42 +0000 (09:55 +0100)
The connect function prints an unintialized error code after an
earlier initialization was removed:

drivers/net/xen-netback/xenbus.c: In function 'connect':
drivers/net/xen-netback/xenbus.c:938:3: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This prints it as -EINVAL instead, which seems to be the most
appropriate error code. Before the patch that caused the warning,
this would print a positive number returned by vsscanf() instead,
which is also wrong. We probably don't need a backport though,
as fixing the warning here should be sufficient.

Fixes: f95842e7a9f2 ("xen: make use of xenbus_read_unsigned() in xen-netback")
Fixes: 8d3d53b3e433 ("xen-netback: Add support for multiple queues")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/net/xen-netback/xenbus.c

index 7356e00fac545d0a38c55a5aeb2c4965d0ff6a70..bfed79877b8a935b7645f65f8d40ac13adca4a2e 100644 (file)
@@ -935,7 +935,7 @@ static void connect(struct backend_info *be)
                                        "multi-queue-num-queues", 1);
        if (requested_num_queues > xenvif_max_queues) {
                /* buggy or malicious guest */
-               xenbus_dev_fatal(dev, err,
+               xenbus_dev_fatal(dev, -EINVAL,
                                 "guest requested %u queues, exceeding the maximum of %u.",
                                 requested_num_queues, xenvif_max_queues);
                return;