diff options
author | Alice Ferrazzi <alicef@gentoo.org> | 2018-03-01 13:46:48 +0000 |
---|---|---|
committer | Alice Ferrazzi <alicef@gentoo.org> | 2018-03-01 13:47:06 +0000 |
commit | ea57e40b92f14ab61fb8a8352c4962a324bde09b (patch) | |
tree | f431bd16631838fb61bb835eb1b4041a01109074 | |
parent | ia64 fix ptrace patch (diff) | |
download | linux-patches-ea57e40b92f14ab61fb8a8352c4962a324bde09b.tar.gz linux-patches-ea57e40b92f14ab61fb8a8352c4962a324bde09b.tar.bz2 linux-patches-ea57e40b92f14ab61fb8a8352c4962a324bde09b.zip |
fix Allocate buffer on heap rather than globally patch4.15-9
bug #646438
-rw-r--r-- | 2901_allocate_buffer_on_heap_rather_than_globally.patch | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/2901_allocate_buffer_on_heap_rather_than_globally.patch b/2901_allocate_buffer_on_heap_rather_than_globally.patch index 1912d9f4..eb5feccc 100644 --- a/2901_allocate_buffer_on_heap_rather_than_globally.patch +++ b/2901_allocate_buffer_on_heap_rather_than_globally.patch @@ -1,6 +1,8 @@ ---- dell-laptop.c.orig 2018-02-28 19:24:04.598049000 +0000 -+++ linux-4.15.0/drivers/platform/x86/dell-laptop.c 2018-02-28 19:40:00.358049000 +0000 -@@ -78,7 +78,6 @@ static struct platform_driver platform_d +diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c +index cd4725e7e0b5..6e8071d493dc 100644 +--- a/drivers/platform/x86/dell-laptop.c ++++ b/drivers/platform/x86/dell-laptop.c +@@ -78,7 +78,6 @@ static struct platform_driver platform_driver = { } }; @@ -8,27 +10,27 @@ static struct platform_device *platform_device; static struct backlight_device *dell_backlight_device; static struct rfkill *wifi_rfkill; -@@ -286,7 +285,8 @@ static const struct dmi_system_id dell_q +@@ -286,7 +285,8 @@ static const struct dmi_system_id dell_quirks[] __initconst = { { } }; -void dell_set_arguments(u32 arg0, u32 arg1, u32 arg2, u32 arg3) -+void dell_set_arguments(struct calling_interface_buffer *buffer, -+ u32 arg0, u32 arg1, u32 arg2, u32 arg3) ++static void dell_fill_request(struct calling_interface_buffer *buffer, ++ u32 arg0, u32 arg1, u32 arg2, u32 arg3) { memset(buffer, 0, sizeof(struct calling_interface_buffer)); buffer->input[0] = arg0; -@@ -295,7 +295,8 @@ void dell_set_arguments(u32 arg0, u32 ar +@@ -295,7 +295,8 @@ void dell_set_arguments(u32 arg0, u32 arg1, u32 arg2, u32 arg3) buffer->input[3] = arg3; } -int dell_send_request(u16 class, u16 select) -+int dell_send_request(struct calling_interface_buffer *buffer, -+ u16 class, u16 select) ++static int dell_send_request(struct calling_interface_buffer *buffer, ++ u16 class, u16 select) { int ret; -@@ -432,21 +433,22 @@ static int dell_rfkill_set(void *data, b +@@ -432,21 +433,22 @@ static int dell_rfkill_set(void *data, bool blocked) int disable = blocked ? 1 : 0; unsigned long radio = (unsigned long)data; int hwswitch_bit = (unsigned long)data - 1; @@ -57,7 +59,7 @@ /* If the hardware switch controls this radio, and the hardware switch is disabled, always disable the radio */ -@@ -454,8 +456,8 @@ static int dell_rfkill_set(void *data, b +@@ -454,8 +456,8 @@ static int dell_rfkill_set(void *data, bool blocked) (status & BIT(0)) && !(status & BIT(16))) disable = 1; @@ -68,7 +70,7 @@ return ret; } -@@ -464,9 +466,11 @@ static void dell_rfkill_update_sw_state( +@@ -464,9 +466,11 @@ static void dell_rfkill_update_sw_state(struct rfkill *rfkill, int radio, { if (status & BIT(0)) { /* Has hw-switch, sync sw_state to BIOS */ @@ -82,7 +84,7 @@ } else { /* No hw-switch, sync BIOS state to sw_state */ rfkill_set_sw_state(rfkill, !!(status & BIT(radio + 16))); -@@ -483,21 +487,22 @@ static void dell_rfkill_update_hw_state( +@@ -483,21 +487,22 @@ static void dell_rfkill_update_hw_state(struct rfkill *rfkill, int radio, static void dell_rfkill_query(struct rfkill *rfkill, void *data) { int radio = ((unsigned long)data & 0xF); @@ -141,7 +143,7 @@ seq_printf(s, "return:\t%d\n", ret); seq_printf(s, "status:\t0x%X\n", status); -@@ -610,22 +616,23 @@ static const struct file_operations dell +@@ -610,22 +616,23 @@ static const struct file_operations dell_debugfs_fops = { static void dell_update_rfkill(struct work_struct *ignored) { @@ -171,7 +173,7 @@ if (wifi_rfkill) { dell_rfkill_update_hw_state(wifi_rfkill, 1, status, hwswitch); -@@ -683,6 +690,7 @@ static struct notifier_block dell_laptop +@@ -683,6 +690,7 @@ static struct notifier_block dell_laptop_rbtn_notifier = { static int __init dell_setup_rfkill(void) { @@ -179,7 +181,7 @@ int status, ret, whitelisted; const char *product; -@@ -698,9 +706,9 @@ static int __init dell_setup_rfkill(void +@@ -698,9 +706,9 @@ static int __init dell_setup_rfkill(void) if (!force_rfkill && !whitelisted) return 0; @@ -200,7 +202,7 @@ struct calling_interface_token *token; int ret; -@@ -860,17 +869,21 @@ static int dell_send_intensity(struct ba +@@ -860,17 +869,21 @@ static int dell_send_intensity(struct backlight_device *bd) if (!token) return -ENODEV; @@ -225,7 +227,7 @@ struct calling_interface_token *token; int ret; -@@ -878,14 +891,17 @@ static int dell_get_intensity(struct bac +@@ -878,14 +891,17 @@ static int dell_get_intensity(struct backlight_device *bd) if (!token) return -ENODEV; @@ -292,7 +294,7 @@ return ret; } -@@ -1233,31 +1251,34 @@ static int kbd_set_level(struct kbd_stat +@@ -1233,31 +1251,34 @@ static int kbd_set_level(struct kbd_state *state, u8 level) static int kbd_get_state(struct kbd_state *state) { @@ -338,7 +340,7 @@ int ret; u32 input1; u32 input2; -@@ -1270,8 +1291,9 @@ static int kbd_set_state(struct kbd_stat +@@ -1270,8 +1291,9 @@ static int kbd_set_state(struct kbd_state *state) input2 |= (state->level & 0xFF) << 16; input2 |= (state->timeout_value_ac & 0x3F) << 24; input2 |= (state->timeout_unit_ac & 0x3) << 30; @@ -350,7 +352,7 @@ return ret; } -@@ -1298,6 +1320,7 @@ static int kbd_set_state_safe(struct kbd +@@ -1298,6 +1320,7 @@ static int kbd_set_state_safe(struct kbd_state *state, struct kbd_state *old) static int kbd_set_token_bit(u8 bit) { @@ -389,7 +391,7 @@ if (ret) return ret; -@@ -2046,6 +2070,7 @@ static struct notifier_block dell_laptop +@@ -2046,6 +2070,7 @@ static struct notifier_block dell_laptop_notifier = { int dell_micmute_led_set(int state) { |