OSDN Git Service

ASoC: SOF: remove redundant null checks of dai
authorColin Ian King <colin.king@canonical.com>
Thu, 2 May 2019 11:33:40 +0000 (12:33 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 3 May 2019 05:54:15 +0000 (14:54 +0900)
commitc437ba0300cec1ca8758fdd71a3b2f8cd02c6e2a
treea9ecd2f05cb802af7b97616173e93faaae9256e0
parent1cd472d2ac1654f939ae01164b29e81fc76e0a93
ASoC: SOF: remove redundant null checks of dai

Currently there are two null checks of pointer dai in function
sof_connect_dai_widget and yet there is no null check of dai
at the end of the function when checking !dai->name.  The latter
would be a null pointer deference if dai is null (as picked up
by static analysis), however the function is only ever called
when dai is successfully allocated, so the null checks are
redundant. Clean up the code by removing the null checks.

Addresses-Coverity: ("Dereference after null check")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/topology.c