platform/chrome: wilco_ec: Use kmemdup in enqueue_events()
Subsystems (2)
PATCH 1/1 platform/chrome: wilco_ec: Use kmemdup in enqueue_events()
Use kmemdup rather than duplicating its implementation
--- drivers/platform/chrome/wilco_ec/event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/platform/chrome/wilco_ec/event.c +1 -2
@@ -248,10 +248,9 @@ static int enqueue_events(struct acpi_device *adev, const u8 *buf, u32 length) offset += event_size;/* Copy event into the queue */ - queue_event =kzalloc (event_size,GFP_KERNEL ); + queue_event =kmemdup (event, event_size,GFP_KERNEL );if (!queue_event)return -ENOMEM ; -memcpy (queue_event, event, event_size);event_queue_push (dev_data->events, queue_event); }
Thanks Yue, looks good to me.
Nick
Quoted 26 lines · YueHaibing
Use kmemdup rather than duplicating its implementation
Signed-off-by YueHaibing <[email protected]>--- drivers/platform/chrome/wilco_ec/event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/platform/chrome/wilco_ec/event.c +1
-2@@ -248,10 +248,9 @@ static int enqueue_events(struct acpi_device *adev, const u8 *buf, u32 length) offset += event_size;/* Copy event into the queue */ - queue_event =kzalloc (event_size,GFP_KERNEL ); + queue_event =kmemdup (event, event_size,GFP_KERNEL );if (!queue_event)return -ENOMEM ; -memcpy (queue_event, event, event_size);event_queue_push (dev_data->events, queue_event); }
Benson Leung
maintainerHey Nick,
Quoted 21 lines · Nick Crews
Thanks Yue, looks good to me.
Nick
Quoted 15 lines · YueHaibing
Use kmemdup rather than duplicating its implementation
Signed-off-by YueHaibing <[email protected]>--- drivers/platform/chrome/wilco_ec/event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/platform/chrome/wilco_ec/event.c +0
-0@@ -248,10 +248,9 @@ static int enqueue_events(struct acpi_device *adev, const u8 *buf, u32 length) offset += event_size;
Quoted 11 lines
drivers/platform/chrome/wilco_ec/event.c static int enqueue_events(struct acpi_device *adev, const u8 *buf, u32 length) · line 256
Quoted 11 lines
drivers/platform/chrome/wilco_ec/event.c +1
-2/* Copy event into the queue */ - queue_event =kzalloc (event_size,GFP_KERNEL ); + queue_event =kmemdup (event, event_size,GFP_KERNEL );if (!queue_event)return -ENOMEM ; -memcpy (queue_event, event, event_size);event_queue_push (dev_data->events, queue_event); }
Looks like this was already incorporated into your commit, platform/chrome: wilco_ec: Use kmemdup in enqueue_events().
Thanks!
Benson
Signature · 7 lines
Benson Leung Staff Software Engineer Chrome OS Kernel Google Inc. [email protected] Chromium OS Project [email protected]
Quoted 24 lines · Benson Leung
Hey Nick,
Quoted 21 lines · Nick Crews
Thanks Yue, looks good to me.
Nick
Quoted 15 lines · YueHaibing
Use kmemdup rather than duplicating its implementation
Signed-off-by YueHaibing <[email protected]>--- drivers/platform/chrome/wilco_ec/event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/platform/chrome/wilco_ec/event.c +0
-0@@ -248,10 +248,9 @@ static int enqueue_events(struct acpi_device *adev, const u8 *buf, u32 length) offset += event_size;
Quoted 14 lines
Quoted 11 lines
drivers/platform/chrome/wilco_ec/event.c static int enqueue_events(struct acpi_device *adev, const u8 *buf, u32 length) · line 256
Quoted 11 lines
drivers/platform/chrome/wilco_ec/event.c +1
-2/* Copy event into the queue */ - queue_event =kzalloc (event_size,GFP_KERNEL ); + queue_event =kmemdup (event, event_size,GFP_KERNEL );if (!queue_event)return -ENOMEM ; -memcpy (queue_event, event, event_size);event_queue_push (dev_data->events, queue_event); }Looks like this was already incorporated into your commit, platform/chrome:
wilco_ec: Use kmemdup inenqueue_events().
Thanks for the note Benson, but I think that must have been a copy pasta error, it was actually included in "platform/chrome: wilco_ec: Add circular buffer as event queue" just so there isn't any confusion later :)
Nick
Quoted 12 lines
Thanks!
Benson--
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
[email protected]
Chromium OS Project
[email protected]