Commit 0f06ac3b authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Juergen Gross

xen-netback: fix error handling output

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: f95842e7 ("xen: make use of xenbus_read_unsigned() in xen-netback")
Fixes: 8d3d53b3 ("xen-netback: Add support for multiple queues")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarPaul Durrant <paul.durrant@citrix.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 999c9af9
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment