Skip to content

Commit

Permalink
Merge tag 'char-misc-4.5-rc4' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
torvalds committed Feb 14, 2016
2 parents 60f4058 + 3b2b9ea commit 58dd2b5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/misc/mei/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
6 changes: 6 additions & 0 deletions drivers/nvmem/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
1 change: 1 addition & 0 deletions drivers/nvmem/qfprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 58dd2b5

Please sign in to comment.