diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-10 09:09:41 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-10 09:09:41 -0800 |
commit | ecf02a607bd801e742d7bb35c6e40f7ca15edf03 (patch) | |
tree | 1cef9c9ad7f7d0dcd26b5ab7072e3289e02ec50b /drivers/platform/x86/sony-laptop.c | |
parent | ccae663cd4f62890d862c660e5ed762eb9821c14 (diff) | |
parent | 9f89748463f13c9657496b12820f09a988ce77ff (diff) | |
download | op-kernel-dev-ecf02a607bd801e742d7bb35c6e40f7ca15edf03.zip op-kernel-dev-ecf02a607bd801e742d7bb35c6e40f7ca15edf03.tar.gz |
Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
Pull x86 platform driver bugfixes from Matthew Garrett.
* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
asus-laptop: Fix potential invalid pointer dereference
Update MAINTAINERS entry
asus-laptop: Do not call HWRS on init
sony-laptop: fix SNC buffer calls when SN06 returns Integers
samsung-laptop: Add quirk for broken acpi_video backlight on N250P
acer-wmi: add Aspire 5741G touchpad toggle key
acer-wmi: change to emit touchpad on off key
acer-wmi: fix obj is NULL but dereferenced
MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer
Diffstat (limited to 'drivers/platform/x86/sony-laptop.c')
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index daaddec..b8ad71f 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -786,28 +786,29 @@ static int sony_nc_int_call(acpi_handle handle, char *name, int *value, static int sony_nc_buffer_call(acpi_handle handle, char *name, u64 *value, void *buffer, size_t buflen) { + int ret = 0; size_t len = len; union acpi_object *object = __call_snc_method(handle, name, value); if (!object) return -EINVAL; - if (object->type == ACPI_TYPE_BUFFER) + if (object->type == ACPI_TYPE_BUFFER) { len = MIN(buflen, object->buffer.length); + memcpy(buffer, object->buffer.pointer, len); - else if (object->type == ACPI_TYPE_INTEGER) + } else if (object->type == ACPI_TYPE_INTEGER) { len = MIN(buflen, sizeof(object->integer.value)); + memcpy(buffer, &object->integer.value, len); - else { + } else { pr_warn("Invalid acpi_object: expected 0x%x got 0x%x\n", ACPI_TYPE_BUFFER, object->type); - kfree(object); - return -EINVAL; + ret = -EINVAL; } - memcpy(buffer, object->buffer.pointer, len); kfree(object); - return 0; + return ret; } struct sony_nc_handles { |