Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <yousaf.kaukab@suse.com>2019-05-02 16:40:48 +0200
committerMian Yousaf Kaukab <yousaf.kaukab@suse.com>2019-05-03 11:20:54 +0200
commitb01a150d890452099792ec9f1dffb2945ae14068 (patch)
tree1ee64af735c516b25d233a2a0b8641dd93e5e366
parent3673108c567e6ef572eb5e802c4108e107a64c97 (diff)
i2c: Make i2c_unregister_device() NULL-aware (bsc#1108193).
-rw-r--r--patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch b/patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch
new file mode 100644
index 0000000000..0f5a6b74cb
--- /dev/null
+++ b/patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch
@@ -0,0 +1,43 @@
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Date: Tue, 31 Oct 2017 16:21:35 +0200
+Subject: i2c: Make i2c_unregister_device() NULL-aware
+
+Git-commit: 7b43dd19c9b13a3f5478b9d88a49a5495399ad29
+Patch-mainline: v4.15-rc1
+References: bsc#1108193
+
+It's a common pattern to be NULL-aware when freeing resources.
+
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/i2c/i2c-core.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
+index 7b08f3446bfc..706164b4c5be 100644
+--- a/drivers/i2c/i2c-core.c
++++ b/drivers/i2c/i2c-core.c
+@@ -819,6 +819,8 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
+ */
+ void i2c_unregister_device(struct i2c_client *client)
+ {
++ if (!client)
++ return;
+ if (client->dev.of_node)
+ of_node_clear_flag(client->dev.of_node, OF_POPULATED);
+ if (ACPI_COMPANION(&client->dev))
+@@ -1436,8 +1438,7 @@ static int __unregister_client(struct device *dev, void *dummy)
+ static int __unregister_dummy(struct device *dev, void *dummy)
+ {
+ struct i2c_client *client = i2c_verify_client(dev);
+- if (client)
+- i2c_unregister_device(client);
++ i2c_unregister_device(client);
+ return 0;
+ }
+
+--
+2.11.0
+
diff --git a/series.conf b/series.conf
index 5035ee855e..abd4e180bd 100644
--- a/series.conf
+++ b/series.conf
@@ -8729,6 +8729,7 @@
patches.drivers/0001-ACPI-APD-Add-clock-frequency-for-ThunderX2-I2C-contr.patch
patches.drivers/0003-i2c-xlp9xx-Get-clock-frequency-with-clk-API.patch
patches.drivers/0004-i2c-xlp9xx-Handle-I2C_M_RECV_LEN-in-msg-flags.patch
+ patches.drivers/0001-i2c-Make-i2c_unregister_device-NULL-aware.patch
patches.drivers/ALSA-line6-add-support-for-POD-HD-DESKTOP
patches.drivers/ALSA-usb-audio-Apply-vendor-ID-matching-for-sample-r
patches.drivers/usb-core-Add-a-helper-function-to-check-the-validity