diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-06-22 07:01:22 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-24 15:38:14 +0300 |
commit | 13c2bede49f996ca34a368dfe05be53d6b2ccc22 (patch) | |
tree | 43b5b9ce5c5f117a411f099211b9979d5324170a | |
parent | 0a0c1b823cbc0b72eb6e0c2cfe5704cf80fe842d (diff) | |
download | linux-13c2bede49f996ca34a368dfe05be53d6b2ccc22.tar.xz |
media: radio: wl1273: add check on core->write() return value
Check return value from call to core->write(), so in case of
error print error message, jump to goto label fail and eventually
return.
Addresses-Coverity-ID: 1226943
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/radio/radio-wl1273.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c index 7240223dc15a..17e82a9a0109 100644 --- a/drivers/media/radio/radio-wl1273.c +++ b/drivers/media/radio/radio-wl1273.c @@ -610,10 +610,21 @@ static int wl1273_fm_start(struct wl1273_device *radio, int new_mode) } } - if (radio->rds_on) + if (radio->rds_on) { r = core->write(core, WL1273_RDS_DATA_ENB, 1); - else + if (r) { + dev_err(dev, "%s: RDS_DATA_ENB ON fails\n", + __func__); + goto fail; + } + } else { r = core->write(core, WL1273_RDS_DATA_ENB, 0); + if (r) { + dev_err(dev, "%s: RDS_DATA_ENB OFF fails\n", + __func__); + goto fail; + } + } } else { dev_warn(dev, "%s: Illegal mode.\n", __func__); } |