OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a55aa89
)
i2c: make i2c_unregister_device() ERR_PTR safe
author
Wolfram Sang
<wsa+renesas@sang-engineering.com>
Mon, 19 Aug 2019 20:48:25 +0000
(22:48 +0200)
committer
Wolfram Sang
<wsa@the-dreams.de>
Thu, 29 Aug 2019 18:38:11 +0000
(20:38 +0200)
We are moving towards returning ERR_PTRs when i2c_new_*_device() calls
fail. Make sure its counterpart for unregistering handles ERR_PTRs as
well.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c
patch
|
blob
|
history
diff --git
a/drivers/i2c/i2c-core-base.c
b/drivers/i2c/i2c-core-base.c
index
f26ed49
..
9c440fa
100644
(file)
--- a/
drivers/i2c/i2c-core-base.c
+++ b/
drivers/i2c/i2c-core-base.c
@@
-832,7
+832,7
@@
EXPORT_SYMBOL_GPL(i2c_new_device);
*/
void i2c_unregister_device(struct i2c_client *client)
{
- if (
!client
)
+ if (
IS_ERR_OR_NULL(client)
)
return;
if (client->dev.of_node) {