techpack: avoid VLA

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
Park Ju Hyung 2019-04-27 02:47:56 +09:00 committed by azrim
parent 57d188e64b
commit de004764d9
No known key found for this signature in database
GPG Key ID: 497F8FB059B45D1C
3 changed files with 7 additions and 4 deletions

View File

@ -859,7 +859,7 @@ static int wcd9xxx_i2c_write_device(struct wcd9xxx *wcd9xxx, u16 reg, u8 *value,
struct i2c_msg *msg;
int ret = 0;
u8 reg_addr = 0;
u8 data[bytes + 1];
u8 data[64 + 1];
struct wcd9xxx_i2c *wcd9xxx_i2c;
wcd9xxx_i2c = wcd9xxx_i2c_get_device_info(wcd9xxx, reg);

View File

@ -533,7 +533,7 @@ static int wcd9xxx_irq_setup_downstream_irq(
int wcd9xxx_irq_init(struct wcd9xxx_core_resource *wcd9xxx_res)
{
int i, ret;
u8 irq_level[wcd9xxx_res->num_irq_regs];
u8 *irq_level;
struct irq_domain *domain;
struct device_node *pnode;
@ -573,7 +573,7 @@ int wcd9xxx_irq_init(struct wcd9xxx_core_resource *wcd9xxx_res)
wcd9xxx_res->irq_level_high[0] = true;
/* mask all the interrupts */
memset(irq_level, 0, wcd9xxx_res->num_irq_regs);
irq_level = kcalloc(wcd9xxx_res->num_irq_regs, sizeof(u8), GFP_KERNEL);
for (i = 0; i < wcd9xxx_res->num_irqs; i++) {
wcd9xxx_res->irq_masks_cur[BIT_BYTE(i)] |= BYTE_BIT_MASK(i);
wcd9xxx_res->irq_masks_cache[BIT_BYTE(i)] |= BYTE_BIT_MASK(i);
@ -618,11 +618,14 @@ int wcd9xxx_irq_init(struct wcd9xxx_core_resource *wcd9xxx_res)
if (ret)
goto fail_irq_init;
kfree(irq_level);
return ret;
fail_irq_init:
dev_err(wcd9xxx_res->dev,
"%s: Failed to init wcd9xxx irq\n", __func__);
kfree(irq_level);
wcd9xxx_irq_put_upstream_irq(wcd9xxx_res);
mutex_destroy(&wcd9xxx_res->irq_lock);
mutex_destroy(&wcd9xxx_res->nested_irq_lock);

View File

@ -779,7 +779,7 @@ static int msm_lsm_check_and_set_lab_controls(struct snd_pcm_substream *substrea
struct lsm_priv *prtd = runtime->private_data;
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct lsm_hw_params *out_hw_params = &prtd->lsm_client->out_hw_params;
u8 chmap[out_hw_params->num_chs];
u8 chmap[16];
u32 ch_idx;
int rc = 0, stage_idx = p_info->stage_idx;