diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/think-lmi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index a01a92769c1a..caa862506ed3 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -317,8 +317,8 @@ static int tlmi_get_pwd_settings(struct tlmi_pwdcfg *pwdcfg) return -EIO; } - copy_size = obj->buffer.length < sizeof(struct tlmi_pwdcfg) ? - obj->buffer.length : sizeof(struct tlmi_pwdcfg); + copy_size = min_t(size_t, obj->buffer.length, sizeof(struct tlmi_pwdcfg)); + memcpy(pwdcfg, obj->buffer.pointer, copy_size); kfree(obj); |