projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62ac88a
)
platform/x86: x86-android-tablets: Fix GPIO lookup leak on error-exit
author
Hans de Goede
<hdegoede@redhat.com>
Sat, 8 Jan 2022 15:49:47 +0000
(16:49 +0100)
committer
Hans de Goede
<hdegoede@redhat.com>
Sat, 8 Jan 2022 15:56:01 +0000
(16:56 +0100)
Fix leaking the registered gpiod_lookup tables when the kcalloc() for the
i2c_clients array fails.
Fixes:
ef2ac11493e2
("platform/x86: x86-android-tablets: Add support for registering GPIO lookup tables")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link:
https://lore.kernel.org/r/20220108154947.136593-1-hdegoede@redhat.com
drivers/platform/x86/x86-android-tablets.c
patch
|
blob
|
history
diff --git
a/drivers/platform/x86/x86-android-tablets.c
b/drivers/platform/x86/x86-android-tablets.c
index
d39da5f
..
3ba63ad
100644
(file)
--- a/
drivers/platform/x86/x86-android-tablets.c
+++ b/
drivers/platform/x86/x86-android-tablets.c
@@
-815,8
+815,10
@@
static __init int x86_android_tablet_init(void)
gpiod_add_lookup_table(gpiod_lookup_tables[i]);
i2c_clients = kcalloc(dev_info->i2c_client_count, sizeof(*i2c_clients), GFP_KERNEL);
- if (!i2c_clients)
+ if (!i2c_clients) {
+ x86_android_tablet_cleanup();
return -ENOMEM;
+ }
i2c_client_count = dev_info->i2c_client_count;
for (i = 0; i < i2c_client_count; i++) {