]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Aug 2019 16:46:54 +0000 (18:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Aug 2019 16:46:54 +0000 (18:46 +0200)
added patches:
ib-directly-cast-the-sockaddr-union-to-aockaddr.patch

queue-4.19/ib-directly-cast-the-sockaddr-union-to-aockaddr.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/ib-directly-cast-the-sockaddr-union-to-aockaddr.patch b/queue-4.19/ib-directly-cast-the-sockaddr-union-to-aockaddr.patch
new file mode 100644 (file)
index 0000000..8c2ed13
--- /dev/null
@@ -0,0 +1,46 @@
+From 3cef0b8297395877695a223f5da5383a3d60aa6c Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Wed, 7 Aug 2019 18:44:12 +0200
+Subject: [PATCH] IB: directly cast the sockaddr union to aockaddr
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+Like commit 641114d2af31 ("RDMA: Directly cast the sockaddr union to
+sockaddr") we need to quiet gcc 9 from warning about this crazy union.
+That commit did not fix all of the warnings in 4.19 and older kernels
+because the logic in roce_resolve_route_from_path() was rewritten
+between 4.19 and 5.2 when that change happened.
+
+Cc: Jason Gunthorpe <jgg@mellanox.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/infiniband/core/sa_query.c |    9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+--- a/drivers/infiniband/core/sa_query.c
++++ b/drivers/infiniband/core/sa_query.c
+@@ -1232,7 +1232,6 @@ static int roce_resolve_route_from_path(
+ {
+       struct rdma_dev_addr dev_addr = {};
+       union {
+-              struct sockaddr     _sockaddr;
+               struct sockaddr_in  _sockaddr_in;
+               struct sockaddr_in6 _sockaddr_in6;
+       } sgid_addr, dgid_addr;
+@@ -1249,12 +1248,12 @@ static int roce_resolve_route_from_path(
+        */
+       dev_addr.net = &init_net;
+-      rdma_gid2ip(&sgid_addr._sockaddr, &rec->sgid);
+-      rdma_gid2ip(&dgid_addr._sockaddr, &rec->dgid);
++      rdma_gid2ip((struct sockaddr *)&sgid_addr, &rec->sgid);
++      rdma_gid2ip((struct sockaddr *)&dgid_addr, &rec->dgid);
+       /* validate the route */
+-      ret = rdma_resolve_ip_route(&sgid_addr._sockaddr,
+-                                  &dgid_addr._sockaddr, &dev_addr);
++      ret = rdma_resolve_ip_route((struct sockaddr *)&sgid_addr,
++                                  (struct sockaddr *)&dgid_addr, &dev_addr);
+       if (ret)
+               return ret;
index 4a4bb4a7a88629b397baa7144f6c2b1aad9602f4..5638e8de4bd8b9a588d8b2caeb17a72a717f851b 100644 (file)
@@ -9,3 +9,4 @@ libnvdimm-bus-fix-wait_nvdimm_bus_probe_idle-abba-de.patch
 hid-wacom-fix-bit-shift-for-cintiq-companion-2.patch
 hid-add-quirk-for-hp-x1200-pixart-oem-mouse.patch
 spi-bcm2835-fix-3-wire-mode-if-dma-is-enabled.patch
+ib-directly-cast-the-sockaddr-union-to-aockaddr.patch