ASoC: tegra: fix mbdrc driver

UBSAN tool reporting shift out of bound warning during the
boot for mbdrc driver. Use 64 bit variable to avoid issue.

Bug 200683609

Change-Id: I53808224584fc52614fd957eef371911f7dd144e
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2554092
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Mohan Kumar
2021-07-05 14:30:36 +05:30
committed by Sameer Pujar
parent d940c0e813
commit cc172ee03a

View File

@@ -145,7 +145,8 @@ static int tegra210_mbdrc_get(struct snd_kcontrol *kcontrol,
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt);
unsigned int mask = (1 << fls(mc->max)) - 1;
unsigned long long fls_val = 1 << fls(mc->max);
unsigned int mask = fls_val - 1;
unsigned int val;
regmap_read(ope->mbdrc_regmap, mc->reg, &val);
@@ -164,7 +165,8 @@ static int tegra210_mbdrc_put(struct snd_kcontrol *kcontrol,
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt);
unsigned int mask = (1 << fls(mc->max)) - 1;
unsigned long long fls_val = 1 << fls(mc->max);
unsigned int mask = fls_val - 1;
unsigned int val;
val = (ucontrol->value.integer.value[0] & mask);