char/misc driver fixes for 4.5-rc4
Here are 3 fixes for some reported issues. Two nvmem driver fixes, and one mei fix. All have been in linux-next just fine. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlbAzXYACgkQMUfUDdst+yloOQCgo2NfGm5sy05mGSmfBanqF8XP lnQAoJte8LiHXdhIXb6b7XnqLDdKTExq =O7sZ -----END PGP SIGNATURE----- Merge tag 'char-misc-4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are 3 fixes for some reported issues. Two nvmem driver fixes, and one mei fix. All have been in linux-next just fine" * tag 'char-misc-4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: nvmem: qfprom: Specify LE device endianness nvmem: core: return error for non word aligned access mei: validate request value in client notify request ioctl
This commit is contained in:
commit
58dd2b5be1
|
@ -458,7 +458,11 @@ static int mei_ioctl_client_notify_request(struct file *file, u32 request)
|
|||
{
|
||||
struct mei_cl *cl = file->private_data;
|
||||
|
||||
return mei_cl_notify_request(cl, file, request);
|
||||
if (request != MEI_HBM_NOTIFICATION_START &&
|
||||
request != MEI_HBM_NOTIFICATION_STOP)
|
||||
return -EINVAL;
|
||||
|
||||
return mei_cl_notify_request(cl, file, (u8)request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -70,6 +70,9 @@ static ssize_t bin_attr_nvmem_read(struct file *filp, struct kobject *kobj,
|
|||
if (pos >= nvmem->size)
|
||||
return 0;
|
||||
|
||||
if (count < nvmem->word_size)
|
||||
return -EINVAL;
|
||||
|
||||
if (pos + count > nvmem->size)
|
||||
count = nvmem->size - pos;
|
||||
|
||||
|
@ -95,6 +98,9 @@ static ssize_t bin_attr_nvmem_write(struct file *filp, struct kobject *kobj,
|
|||
if (pos >= nvmem->size)
|
||||
return 0;
|
||||
|
||||
if (count < nvmem->word_size)
|
||||
return -EINVAL;
|
||||
|
||||
if (pos + count > nvmem->size)
|
||||
count = nvmem->size - pos;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ static struct regmap_config qfprom_regmap_config = {
|
|||
.reg_bits = 32,
|
||||
.val_bits = 8,
|
||||
.reg_stride = 1,
|
||||
.val_format_endian = REGMAP_ENDIAN_LITTLE,
|
||||
};
|
||||
|
||||
static struct nvmem_config econfig = {
|
||||
|
|
Loading…
Reference in New Issue