]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Jun 2018 06:35:05 +0000 (08:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Jun 2018 06:35:05 +0000 (08:35 +0200)
added patches:
gpio-no-null-owner.patch

queue-4.14/gpio-no-null-owner.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/gpio-no-null-owner.patch b/queue-4.14/gpio-no-null-owner.patch
new file mode 100644 (file)
index 0000000..9a9ef6f
--- /dev/null
@@ -0,0 +1,46 @@
+From 7d18f0a14aa6a0d6bad39111c1fb655f07f71d59 Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Tue, 16 Jan 2018 08:29:50 +0100
+Subject: gpio: No NULL owner
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+commit 7d18f0a14aa6a0d6bad39111c1fb655f07f71d59 upstream.
+
+Sometimes a GPIO is fetched with NULL as parent device, and
+that is just fine. So under these circumstances, avoid using
+dev_name() to provide a name for the GPIO line.
+
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Cc: Daniel Rosenberg <drosen@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpio/gpiolib.c |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpio/gpiolib.c
++++ b/drivers/gpio/gpiolib.c
+@@ -3313,6 +3313,8 @@ struct gpio_desc *__must_check gpiod_get
+       struct gpio_desc *desc = NULL;
+       int status;
+       enum gpio_lookup_flags lookupflags = 0;
++      /* Maybe we have a device name, maybe not */
++      const char *devname = dev ? dev_name(dev) : "?";
+       dev_dbg(dev, "GPIO lookup for consumer %s\n", con_id);
+@@ -3341,8 +3343,11 @@ struct gpio_desc *__must_check gpiod_get
+               return desc;
+       }
+-      /* If a connection label was passed use that, else use the device name as label */
+-      status = gpiod_request(desc, con_id ? con_id : dev_name(dev));
++      /*
++       * If a connection label was passed use that, else attempt to use
++       * the device name as label
++       */
++      status = gpiod_request(desc, con_id ? con_id : devname);
+       if (status < 0)
+               return ERR_PTR(status);
index f0f797ed4daf68ada2c72971e757b3254def8f58..0c1630260a11b0974d227a51403f1a336d35dea5 100644 (file)
@@ -1,3 +1,4 @@
 netfilter-nf_tables-fix-null-pointer-dereference-on-nft_ct_helper_obj_dump.patch
 blkdev_report_zones_ioctl-use-vmalloc-to-allocate-large-buffers.patch
 af_key-always-verify-length-of-provided-sadb_key.patch
+gpio-no-null-owner.patch