Re: [PATCH -next] ASoC: sun4i-codec: Fix error return code in sun4i_codec_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

On 08/10/2016 10:04 PM, Chen-Yu Tsai wrote:
> On Wed, Aug 10, 2016 at 9:42 PM, Wei Yongjun <weiyj.lk@xxxxxxxxx> wrote:
>> Fix to return error code -ENOMEM instead of 0 when create card
>> failed, as done elsewhere in this function.
>>
>> Fixes: 45fb6b6f2aa3 ("ASoC: sunxi: add support for the on-chip
>> codec on early Allwinner SoCs")
>> Signed-off-by: Wei Yongjun <weiyj.lk@xxxxxxxxx>
>> ---
>>  sound/soc/sunxi/sun4i-codec.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
>> index 0e19c50..e741659 100644
>> --- a/sound/soc/sunxi/sun4i-codec.c
>> +++ b/sound/soc/sunxi/sun4i-codec.c
>> @@ -846,6 +846,7 @@ static int sun4i_codec_probe(struct platform_device *pdev)
>>         card = sun4i_codec_create_card(&pdev->dev);
>>         if (!card) {
>>                 dev_err(&pdev->dev, "Failed to create our card\n");
>> +               ret = -ENOMEM;
>>                 goto err_unregister_codec;
>>         }
>>
> This works, though it might be better to fix the create_card function and
> any custom functions called in there to pass back a proper error value.
>
Since sun4i_codec_create_card() can only failed when kmalloc() return NULL, so
still need to change sun4i_codec_create_card()?


_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux