Skip to content

Commit

Permalink
misc: surface_sam: Update based on module
Browse files Browse the repository at this point in the history
Update Surface System Aggregator Module driver based on module.

Changes:
- Fix a memory allocation bug causing crashes through memory corruption and
  invalid access.

Links:
- SAM: linux-surface/surface-aggregator-module@9f9a5fc
  • Loading branch information
qzed committed Sep 19, 2020
1 parent a604178 commit 47d0191
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/surface_aggregator/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ int ssam_request_sync_alloc(size_t payload_len, gfp_t flags,
{
size_t msglen = SSH_COMMAND_MESSAGE_LENGTH(payload_len);

*rqst = kzalloc(sizeof(*rqst) + msglen, flags);
*rqst = kzalloc(sizeof(**rqst) + msglen, flags);
if (!*rqst)
return -ENOMEM;

Expand Down
2 changes: 2 additions & 0 deletions drivers/misc/surface_aggregator/ssh_request_layer.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// SPDX-License-Identifier: GPL-2.0-or-later

#include <asm/unaligned.h>
#include <linux/atomic.h>
#include <linux/completion.h>
#include <linux/error-injection.h>
#include <linux/ktime.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/workqueue.h>
Expand Down

0 comments on commit 47d0191

Please sign in to comment.