Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branch 'regmap/topic/core' into regmap-next

+7 -4
+3 -3
drivers/base/regmap/regmap-mmio.c
··· 61 61 } 62 62 } 63 63 64 - static inline void regmap_mmio_count_check(size_t count) 64 + static inline void regmap_mmio_count_check(size_t count, u32 offset) 65 65 { 66 - BUG_ON(count % 2 != 0); 66 + BUG_ON(count <= offset); 67 67 } 68 68 69 69 static int regmap_mmio_gather_write(void *context, ··· 120 120 struct regmap_mmio_context *ctx = context; 121 121 u32 offset = ctx->reg_bytes + ctx->pad_bytes; 122 122 123 - regmap_mmio_count_check(count); 123 + regmap_mmio_count_check(count, offset); 124 124 125 125 return regmap_mmio_gather_write(context, data, ctx->reg_bytes, 126 126 data + offset, count - offset);
+4 -1
drivers/base/regmap/regmap.c
··· 1615 1615 size_t pair_size = reg_bytes + pad_bytes + val_bytes; 1616 1616 size_t len = pair_size * num_regs; 1617 1617 1618 + if (!len) 1619 + return -EINVAL; 1620 + 1618 1621 buf = kzalloc(len, GFP_KERNEL); 1619 1622 if (!buf) 1620 1623 return -ENOMEM; ··· 1665 1662 int ret; 1666 1663 int i, n; 1667 1664 struct reg_default *base; 1668 - unsigned int this_page; 1665 + unsigned int this_page = 0; 1669 1666 /* 1670 1667 * the set of registers are not neccessarily in order, but 1671 1668 * since the order of write must be preserved this algorithm