diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-10-04 13:22:09 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-07 13:53:23 +0100 |
commit | a9d273671440c439c4f236123c59dd839c1a0eb7 (patch) | |
tree | 7a6317d0e08abbca1de79b53280ea7f02cc9a74d /sound/sparc | |
parent | e9e8fc9ed63e7e0fb30f8612f628924fbd868467 (diff) |
ASoC: fsl_mqs: Fix error handling in probe
There are several problems in the error handling in fsl_mqs_probe().
1) "ret" isn't initialized on some paths. GCC has a feature which
warns about uninitialized variables but the code initializes "ret"
to zero at the start of the function so the checking is turned off.
2) "gpr_np" is a pointer so initializing it to zero is confusing and
generates a Sparse warning.
3) of_parse_phandle() doesn't return error pointers on error, it returns
NULL.
4) If devm_snd_soc_register_component() fails then the function should
free the "gpr_np".
Fixes: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20191004102208.GB823@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/sparc')
0 files changed, 0 insertions, 0 deletions