Skip to content

Commit 58dd2b5

Browse files
committed
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
2 parents 60f4058 + 3b2b9ea commit 58dd2b5

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

drivers/misc/mei/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,11 @@ static int mei_ioctl_client_notify_request(struct file *file, u32 request)
458458
{
459459
struct mei_cl *cl = file->private_data;
460460

461-
return mei_cl_notify_request(cl, file, request);
461+
if (request != MEI_HBM_NOTIFICATION_START &&
462+
request != MEI_HBM_NOTIFICATION_STOP)
463+
return -EINVAL;
464+
465+
return mei_cl_notify_request(cl, file, (u8)request);
462466
}
463467

464468
/**

drivers/nvmem/core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ static ssize_t bin_attr_nvmem_read(struct file *filp, struct kobject *kobj,
7070
if (pos >= nvmem->size)
7171
return 0;
7272

73+
if (count < nvmem->word_size)
74+
return -EINVAL;
75+
7376
if (pos + count > nvmem->size)
7477
count = nvmem->size - pos;
7578

@@ -95,6 +98,9 @@ static ssize_t bin_attr_nvmem_write(struct file *filp, struct kobject *kobj,
9598
if (pos >= nvmem->size)
9699
return 0;
97100

101+
if (count < nvmem->word_size)
102+
return -EINVAL;
103+
98104
if (pos + count > nvmem->size)
99105
count = nvmem->size - pos;
100106

drivers/nvmem/qfprom.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static struct regmap_config qfprom_regmap_config = {
2121
.reg_bits = 32,
2222
.val_bits = 8,
2323
.reg_stride = 1,
24+
.val_format_endian = REGMAP_ENDIAN_LITTLE,
2425
};
2526

2627
static struct nvmem_config econfig = {

0 commit comments

Comments
 (0)