diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-07-26 06:28:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-03 18:03:55 -0400 |
commit | 0dcd47426abde223b2386165470ec45d9777478e (patch) | |
tree | 4dd22c7e7ffbc223f33b5951b2a111f0d0d8942d /sound/soc/ux500/ux500_msp_dai.c | |
parent | fbfe69836c088bcc0c5a0f32e788d3aef5f66aca (diff) |
ASoC: ux500: Strengthen error checking after memory allocation
Currently there is no out-of-memory error checking after attempting
to allocate memory for the ux500_msp or ux500_msp_i2s_drvdata data
structures. Instead we go about populating them regardless. This
patch applies the necessary error checking to prevent a panic.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/ux500/ux500_msp_dai.c')
-rw-r--r-- | sound/soc/ux500/ux500_msp_dai.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index 057e28ef770e..772cb19d2fb3 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c | |||
@@ -760,6 +760,9 @@ static int __devinit ux500_msp_drv_probe(struct platform_device *pdev) | |||
760 | drvdata = devm_kzalloc(&pdev->dev, | 760 | drvdata = devm_kzalloc(&pdev->dev, |
761 | sizeof(struct ux500_msp_i2s_drvdata), | 761 | sizeof(struct ux500_msp_i2s_drvdata), |
762 | GFP_KERNEL); | 762 | GFP_KERNEL); |
763 | if (!drvdata) | ||
764 | return -ENOMEM; | ||
765 | |||
763 | drvdata->fmt = 0; | 766 | drvdata->fmt = 0; |
764 | drvdata->slots = 1; | 767 | drvdata->slots = 1; |
765 | drvdata->tx_mask = 0x01; | 768 | drvdata->tx_mask = 0x01; |