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: 9e28f653 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20191004102208.GB823@mwandaSigned-off-by: Mark Brown <broonie@kernel.org>
Showing
Please register or sign in to comment